[FFmpeg-devel] Timestamp issues in live RTP->mpegts bridges

Luca Abeni lucabe72
Tue Jan 20 13:32:42 CET 2009

Hi Alexandre,

>> Can you dump the H.263 
>> bitstream to a file (with vcodec copy) and then do "ffmpeg -i" on that 
>> file and post the result?
> OK, I did that. But I cannot simply generate a flat stream with standard 
> options (or maybe I'm missing one):
>   ./ffmpeg -i /tmp/video/h263.sdp -vcodec copy - > a.263
>   ./ffmpeg -i /tmp/video/h263.sdp -vcodec copy a.263

I suspect the correct command line is something like
	ffmpeg -i h263.sdp -vcodec copy a.h263
(or you have to add "-f raw" before the output file).

> However I worked around that by putting an 'fwrite()' (conditioned by an 
> environment variable) in my H263-specific parse_packet function, as 
> suggested by Michael last week.
> The generated flat H263 bitstream is played by mplayer, but too fast.
> The output of ffmpeg -i is:
>   Input #0, h263, from 'a.263':
>     Duration: N/A, bitrate: N/A
>       Stream #0.0: Video: h263, yuv420p, 176x144 [PAR 12:11 DAR 4:3], 
> 29.97 tb(r)
>   At least one output file must be specified
> So it is wrongly guessing 29.97.

I suspect the frame rate is stored in the bitstream, and the codec is
reading such value, which turns out to be wrong... I do not know if this
is a bug in the decoder, or in the enocoder...
This looks like something for the codecs guys: can you open an issue on
the bugtracker, or send an email in a new thread describing this problem?
(you will have to upload the H.263 bitstream on upload.ffmpeg.org, as
indicated in the bugreport page).

> Maybe I could "force" the fps through some SDP parameter or command-line 
> option ?

I do not think this would help: if the H.263 decoder is detecting a 29.97
frame rate, it will probably overwrite the value you write originally...

> Also, I was wondering: instead of giving a fixed frame rate, is there a 
> way of just inheriting the input timestamps ?

I think what you want here is variable frame-rate... I do not know if
H.263 supports it. If yes, in theory you should not need any additional
command line option (but I am not sure, as I have no experience with
variable frame-rate).

Anyway, I think you are now hitting a codec-related bug...


More information about the ffmpeg-devel mailing list