[FFmpeg-devel] [RFC] SRT demuxer

Reimar Döffinger Reimar.Doeffinger
Mon Feb 16 17:32:23 CET 2009


On Wed, Feb 11, 2009 at 03:21:45PM +0100, Patrik Kullman wrote:
> [mpeg4 @ 0x23324d0]Invalid and inefficient vfw-avi packed B frames detected
> [srt @ 0x2328d50]65 q=31.0 size=      14kB time=35.37 bitrate=   3.2kbits/s    
> 
> call decode_frame - sub->pts: 940
> 
> frame=  941 fps=542 q=31.0 Lsize=    2150kB time=39.25 bitrate= 448.7kbits/s    
> video:1765kB audio:310kB global headers:0kB muxing overhead 3.621500%
> 
> 
> ffmpeg -fdebug 1 tells me that av_read_packet/av_read_frame_internal is only called once for the srt demuxer:
> 
> [srt @ 0x1b4aa60]av_read_packet stream=0, pts=26000, dts=26000, size=79,  flags=0
> [srt @ 0x1b4aa60]av_read_frame_internal stream=0, pts=26000, dts=26000, size=79, flags=0

Given the whole file is only 39 seconds and the first subtitle is at 26
seconds that is not that surprising.

> 	start_ms += start_hrs * 60 * 60 * 1000;
> 	start_ms += start_mins * 60 * 1000;
> 	start_ms += start_secs * 1000;
> 
> 	end_ms += end_hrs * 60 * 60 * 1000;
> 	end_ms += end_mins * 60 * 1000;
> 	end_ms += end_secs * 1000;

You claim your time stamps wrap around at 64 bits in av_set_pts_info, so
either use 64 bit variables or change av_set_pts_info

>         pkt->pts = start_ms;
> 	pkt->duration = end_ms - start_ms;

Stray tab. But more importantly, duration is defined as pts of the next
packet minus pts of this packet, this is not the same thing as the
duration in the srt file, since srt allows packets to overlap, FFmpeg
does not.




More information about the ffmpeg-devel mailing list