[FFmpeg-devel] [PATCH] Pass on position from ffmpeg to filters

Michael Niedermayer michaelni
Sat Jul 10 23:45:43 CEST 2010


On Sat, Jul 10, 2010 at 11:10:30PM +0200, V?ctor Paesa wrote:
> Hi,
> ffplay already passes on the file position to filters, but ffmpeg does not.
> 	
> I run the patched ffmpeg on the files generated by 'make test':	
> for i in tests/data/lavf/lavf.*
> do
>   echo pos_$i
>   ./ffmpeg -debug 1 -vframes 25 -i $i -vf null -y a.avi 2>&1 </dev/null
> done | grep pos
> 
> For ASF, DV, FLV, GXF, MXF, SWF, y4m, the content of ist->st->cur_pkt.pos
> does not look a reliable position.
> 
> Thanks in advance for your review,
> V?ctor

>  ffmpeg.c                  |    5 ++++-
>  libavfilter/vsrc_buffer.c |    5 ++++-
>  libavfilter/vsrc_buffer.h |    2 +-
>  3 files changed, 9 insertions(+), 3 deletions(-)
> ae2a17e652143de4ce4317537bcff1cbd4d3a040  ffmpeg.pos.1.diff
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 24162)
> +++ ffmpeg.c	(working copy)
> @@ -1648,7 +1648,10 @@
>              // add it to be filtered
>              av_vsrc_buffer_add_frame(ist->input_video_filter, &picture,
>                                       ist->pts,
> -                                     ist->st->codec->sample_aspect_ratio);
> +                                     ist->st->codec->sample_aspect_ratio,
> +                                     ist->st->cur_pkt.pos);

this looks wrong, pos from the AVPacket you get from the demuxer/parser
should be used not some lavf internal one

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100710/e6e89a2c/attachment.pgp>



More information about the ffmpeg-devel mailing list