[FFmpeg-devel] [RFC] SRT demuxer

Patrik Kullman patrik
Mon Feb 16 19:45:31 CET 2009


On Mon, 2009-02-16 at 17:32 +0100, Reimar D?ffinger wrote:
> 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.

I just think that dts/pts should be converted to somewhere around 24
frames per second * 26 seconds = 624 pts/dts to match with the avi
pts/dts?

The file isn't 39 seconds long, I cancelled it after 35 seconds since it
only wrote 14KB, after which it flushed I guess, taking 4 seconds and w
riting 2136KB to outfile and finally calling the SRT decoder once.

The SRT decoder should have been called at or before 26 seconds?

> 
> > 	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

Ok, will fix this.

Do you think it might be related to the issue?

> >         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.

Is duration important to set at this point?
I have the same problem when I don't set it.






More information about the ffmpeg-devel mailing list