[FFmpeg-devel] [PATCH] Make ffmpeg.c use print_error() when it can't read a ffserver stream

Stefano Sabatini stefano.sabatini-lala
Sat Jun 7 20:04:17 CEST 2008


Hi, as in subject.

This is more consistent with the other use of av_open_input_file() in
ffmpeg.c in opt_input_file, which is:

    /* open the input file with generic libav function */
    err = av_open_input_file(&ic, filename, file_iformat, 0, ap);
    if (err < 0) {
        print_error(filename, err);
        av_exit(1);
    }

also the error message reported by print_error() should be at least
theoretically more accurate than the generic one currently used in
read_ffserver_streams():

fprintf(stderr, "Could not read stream parameters from '%s'\n", filename);

This will lead to error messages of the kind:
stefano at geppetto ~/s/ffmpeg> ffmpeg -f video4linux -s 640x480 -r 25 -i /dev/video0 http://localhost:8090/feed1.ffm
[...]
Input #0, video4linux, from '/dev/video0':
  Duration: N/A, start: 1212861538.055957, bitrate: 92160 kb/s
    Stream #0.0: Video: rawvideo, yuv420p, 640x480, 92160 kb/s, 25.00 tb(r)
http://localhost:8090/feed1.ffm: I/O error occurred
Usually that means that input file is truncated and/or corrupted.

BTW, I also think that the EIO error code returned in this case when
we try to open a closed TCP port is still too vague, I'd like
something more meaningful, which leads to the old discussion about the
error codes managed by FFmpeg.

Do you have you any hint (maybe just another more specific error code
describing the current situation)?

Best regards.
-- 
FFmpeg = Frenzy & Fast MultiPurpose EnGine
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-print-error-when-reading-ffserver-streams-00.patch
Type: text/x-diff
Size: 1433 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080607/8a51b874/attachment.patch>



More information about the ffmpeg-devel mailing list