[FFmpeg-devel] [PATCH] Seeking and resync support in nuv demuxer

elupus elupus
Sat May 24 11:16:57 CEST 2008


Here is a patch too support seeking in nuv files. It adds index generation,
read_timestamp and arbitrary postion resync support.

To notice if a stream resync is required (input stream location changed
outside demuxer), it stores a stream position on each read. Also since
resync positions in nuv files are quite scarce, it also considers all
indexed locations as valid.

I noticed something odd while doing this patch. What is packet.pos supposed
to mean. In the nuv demuxer it means where in the stream the payload part
of a demuxpacket starts. This position is not a position where reading can
start as the header must be read first. So shouldn't the pkt.pos mean the
location where the header for the packet starts?

Also too speed up seeks using av_seek_frame_binary, I added index entries
when a timestamp is found using read_timestamp. However wouldn't it be
better to add this to av_seek_frame_binary? perhaps only when
AVFMT_GENERIC_INDEX is set in format.

On the note of AVFMT_GENERIC_INDEX, that only works if the stream is set to
require parsing. Non parsed packets are not considered. Even if they have


More information about the ffmpeg-devel mailing list