Mark Thompson: > On 27/04/2025 19:42, Andreas Rheinhardt wrote: >> Patches attached. >> >> - Andreas > >> [PATCH 1/7] avformat/apvenc: Only allow APV > > Oops, sure. > >> [PATCH 2/7] avformat/apvenc: Remove unused header > > Sure. > >> [PATCH 3/7] avformat/apvdec: Use ffio_read_size() > > Is there a cleaner way to discard very short files without reading them? The > minimum size of a valid is significantly larger than this, and an early > failure would be nice rather than it get packetised and something later has > to realise it's bad.
There is avio_size(). But I know of no demuxer that uses it to discard small files. (What is the minimum size of a valid file?) > >> [PATCH 4/7] avformat/apvdec: Remove inappropriate flags > > What does the GENERIC_INDEX flag affect here? > With the flag set, the demux code adds index entries for keyframes based on AVPacket.pos. For this demuxer, AVPacket.pos points to the position of the signature, not of the access unit size field which is where the read_packet() code expects to be when called. So with the current code, seeking to an already encountered place will lead to an APV_SIGNATURE being mistaken for an access unit size. You can see this for yourself with ffmpeg -stream_loop 50 -i $(FATE_SUITE)/apv/profile_422-10.apv -c copy -f null - An alternative would be to decrement AVPacket.pos by four. > Currently mpv does successfully seek in a raw file (to already-seen places), > but this may or may not be related. IIRC mpv caches a certain amount of data (in the form of AVPackets IIRC) in order to enable short seeks backwards and forwards from the current position. I don't think it calls the avformat seek functions for your seeks. - Andreas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".