[FFmpeg-devel] [PATCH] Fix Incorrect Display of ASF/WMV Duration

Michael Niedermayer michaelni
Sun Aug 30 02:51:38 CEST 2009


On Sat, Aug 29, 2009 at 04:19:07AM -0700, Josh Harris wrote:
> On Tue, 22 Apr 2008 20:08:39 +0000 (20:08 +0000) a commit was made to
> libavformat/asf.c to "read asf file header fields in the right order." 
> The code changed the order so that play_time is correctly read from the
> asf/wmv header before send_time, however, the calculation for file
> duration was not changed.  When the header was read in the wrong order,
> the file duration was calculated using send_time and so ffmpeg displayed
> the correct file duration.  Now that play_time and send_time have been
> reversed, the file duration calculation needs to be reversed also.
> 
> The original commit can be viewed here:
> http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=c2f3cba296fb760c3734ba749fa7a8575b6442cc
> 
> 
> Using Microsoft's "Windows Media ASF View," the file TL1-001.wmv has the
> following attributes:
> Duration      00:12.000
> Send Duration 00:06.976
> Preroll       00:05.000
> 
> 
> And output from two different revisions of ffmpeg is as follows:
> 
> This is correct
> 
> FFmpeg version SVN-r12920, Copyright (c) 2000-2008 Fabrice Bellard, et al.
>   configuration: --enable-memalign-hack --enable-postproc
> --enable-swscale --enable-gpl --enable-liba52 --enable-libfaac
> --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libvorbis
> --enable-libtheora --enable-libx264 --enable-libxvid --disable-ffserver
> --disable-ffplay --enable-avisynth --enable-small --enable-pthreads
> --cpu=i686
>   libavutil version: 49.6.0
>   libavcodec version: 51.55.0
>   libavformat version: 52.13.0
>   libavdevice version: 52.0.0
>   built on Apr 21 2008 19:08:52, gcc: 4.2.3
> 
> Seems stream 0 codec frame rate differs from container frame rate:
> 1000.00 (1000/1) -> 30.00 (30/1)
> Input #0, asf, from 'F:/TLI1-001.wmv':
>   Duration: 00:00:07.00, start: 5.000000, bitrate: 5893 kb/s
>     Stream #0.0: Video: wmv3, yuv420p, 864x1232, 10000 kb/s, 30.00 tb(r)
> 
> 
> This is incorrect
> 
> FFmpeg version SVN-r19737, Copyright (c) 2000-2009 Fabrice Bellard, et al.
>   configuration: --enable-memalign-hack --prefix=/mingw
> --cross-prefix=i686-mingw32- --cc=ccache-i686-mingw32-gcc
> --target-os=mingw32 --arch=i686 --cpu=i686 --enable-avisynth
> --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm
> --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheora
> --enable-libspeex --enable-libmp3lame --enable-libopenjpeg
> --enable-libxvid --enable-libschroedinger --enable-libx264
>   libavutil     50. 3. 0 / 50. 3. 0
>   libavcodec    52.34. 0 / 52.34. 0
>   libavformat   52.38. 0 / 52.38. 0
>   libavdevice   52. 2. 0 / 52. 2. 0
>   libswscale     0. 7. 1 /  0. 7. 1
>   built on Aug 29 2009 04:03:37, gcc: 4.2.4
> 
> Seems stream 0 codec frame rate differs from container frame rate:
> 1000.00 (1000/1) -> 30.00 (30/1)
> Input #0, asf, from 'F:/TLI1-001.wmv':
>   Duration: 00:00:01.97, start: 5.000000, bitrate: 20878 kb/s
>     Stream #0.0(eng): Video: wmv3, yuv420p, 864x1232, 10000 kb/s, 30
> tbr, 1k tbn, 1k tbc

>  asfdec.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> a7ae9adfebef16dde11fd8343f5e7e317fa92651  asf_r18800.diff

ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- 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/20090830/14121cfe/attachment.pgp>



More information about the ffmpeg-devel mailing list