[FFmpeg-trac] #3537(undetermined:new): Wrong duration of some WMV to MP4 file or wrong meta data with ffmpeg 2.1 and 2.2, but ok with 1.2 and old

FFmpeg trac at avcodec.org
Mon Apr 7 10:40:30 CEST 2014


#3537: Wrong duration of some WMV to MP4 file or wrong meta data with ffmpeg 2.1
and 2.2, but ok with 1.2 and old
-------------------------------------+-------------------------------------
             Reporter:  vikigns      |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 Try convert some parts of WMV file to MP4
 How to reproduce:
 {{{
 % /usr/local/bin/ffmpeg -ss 10 -t 29 -i /home/1280.wmv -f mp4 -s 640:360
 -r 29.97 -vcodec libx264 -preset slow -threads 2 -g 24 -b 750k -bt 750k
 -acodec libfaac -ac 2  -ab 32k -async 1 -y -profile baseline
 /home/0003-test-F.1.mp4
 ffmpeg version N-62246-g02497a5 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Apr  7 2014 08:03:10 with gcc 4.2.1 (GCC) 20070831 patched
 [FeeBSD]
   configuration: --disable-indev=alsa --disable-outdev=alsa --enable-
 libopencore-amrnb --disable-libopencore-amrwb --disable-libass --disable-
 libcdio --enable-libcelt --enable-libfaac --disable-libfdk-aac --enable-
 ffserver --enable-fontconfig --enable-libfreetype --enable-frei0r
 --enable-gnutls --disable-libgsm --enable-iconv --disable-indev=jack
 --disable-libmp3lame --disable-libbluray --disable-libv4l2 --disable-
 indev=v4l2 --disable-outdev=v4l2 --disable-libmodplug --disable-openal
 --disable-indev=openal --disable-libopenjpeg --disable-libopus --disable-
 libpulse --disable-indev=pulse --disable-outdev=pulse --disable-librtmp
 --enable-libschroedinger --disable-libspeex --enable-libtheora --disable-
 vaapi --disable-vdpau --enable-libvorbis --disable-libvo-aacenc --disable-
 libvo-amrwbenc --enable-libvpx --enable-libx264 --enable-libxvid
 --prefix=/usr/local --mandir=/usr/local/man
 --datadir=/usr/local/share/ffmpeg --enable-shared --enable-gpl --enable-
 postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-
 memalign-hack --disable-libstagefright-h264 --disable-libutvideo
 --disable-libsoxr --cc=cc --extra-cflags='-msse
 -I/usr/local/include/vorbis -I/usr/local/include' --extra-
 ldflags='-L/usr/local/lib ' --extra-libs=-pthread --disable-debug
 --disable-ffplay --disable-outdev=sdl --enable-nonfree --enable-version3
   libavutil      52. 74.100 / 52. 74.100
   libavcodec     55. 58.102 / 55. 58.102
   libavformat    55. 36.102 / 55. 36.102
   libavdevice    55. 11.100 / 55. 11.100
   libavfilter     4.  3.100 /  4.  3.100
   libavresample   1.  2.  0 /  1.  2.  0
   libswscale      2.  6.100 /  2.  6.100
   libswresample   0. 18.100 /  0. 18.100
   libpostproc    52.  3.100 / 52.  3.100
 [wmv3 @ 0x8088e4620] Extra data: 8 bits left, value: 0
 Guessed Channel Layout for  Input Stream #0.0 : stereo
 Input #0, asf, from '/home/1280.wmv':
   Metadata:
     SfOriginalFPS   : 300000
     WMFSDKVersion   : 12.0.7600.16385
     WMFSDKNeeded    : 0.0.0.0000
     _SfMarkerDuration_0: 0
     IsVBR           : 0
     DeviceConformanceTemplate: MP at HL
   Duration: 00:21:25.36, start: 0.000000, bitrate: 3157 kb/s
     Chapter #0.0: start 56.589000, end 1285.363000
     Metadata:
       title           :
     Stream #0:0: Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo,
 fltp, 96 kb/s
     Stream #0:1: Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p,
 1280x720, 3049 kb/s, 30 tbr, 1k tbn, 1k tbc
 Please use -b:a or -b:v, -b is ambiguous
 Please use -profile:a or -profile:v, -profile is ambiguous
 -async is forwarded to lavfi similarly to -af
 aresample=async=1:min_hard_comp=0.100000:first_pts=0.
 [libx264 @ 0x8088e4b20] using cpu capabilities: MMX2 SSE2Fast SSSE3
 FastShuffle SSE4.2 AVX
 [libx264 @ 0x8088e4b20] profile Constrained Baseline, level 3.0
 [libx264 @ 0x8088e4b20] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft
 2003-2012 - http://www.videolan.org/x264.html - options: cabac=0 ref=5
 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00
 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0
 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=2
 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=24
 keyint_min=2 scenecut=40 intra_refresh=0 rc_lookahead=24 rc=abr mbtree=1
 bitrate=750 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
 aq=1:1.00
 [wmv3 @ 0x8088e4620] Extra data: 8 bits left, value: 0
 Output #0, mp4, to '/home/0003-test-F.1.mp4':
   Metadata:
     SfOriginalFPS   : 300000
     WMFSDKVersion   : 12.0.7600.16385
     WMFSDKNeeded    : 0.0.0.0000
     _SfMarkerDuration_0: 0
     IsVBR           : 0
     DeviceConformanceTemplate: MP at HL
     encoder         : Lavf55.36.102
     Chapter #0.0: start 55.589000, end 1284.363000
     Metadata:
       title           :
     Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p,
 640x360, q=-1--1, 750 kb/s, 11988 tbn, 29.97 tbc
     Stream #0:1: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 44100 Hz,
 stereo, s16, 32 kb/s
 Stream mapping:
   Stream #0:1 -> #0:0 (wmv3 -> libx264)
   Stream #0:0 -> #0:1 (wmav2 -> libfaac)
 Press [q] to stop, [?] for help
 frame=  870 fps= 63 q=-1.0 Lsize=    3051kB time=00:00:29.02 bitrate=
 860.9kbits/s
 video:2836kB audio:189kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.858561%
 [libx264 @ 0x8088e4b20] frame I:37    Avg QP:16.11  size: 21824
 [libx264 @ 0x8088e4b20] frame P:833   Avg QP:21.53  size:  2516
 [libx264 @ 0x8088e4b20] mb I  I16..4: 47.0%  0.0% 53.0%
 [libx264 @ 0x8088e4b20] mb P  I16..4:  1.9%  0.0%  1.0%  P16..4: 31.6%
 7.4%  3.8%  0.0%  0.0%    skip:54.4%
 [libx264 @ 0x8088e4b20] final ratefactor: 19.71
 [libx264 @ 0x8088e4b20] coded y,uvDC,uvAC intra: 45.1% 49.5% 30.4% inter:
 8.8% 14.1% 2.4%
 [libx264 @ 0x8088e4b20] i16 v,h,dc,p: 47% 27%  8% 17%
 [libx264 @ 0x8088e4b20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 15% 12% 10% 11%
 9% 12%  9% 11%
 [libx264 @ 0x8088e4b20] i8c dc,h,v,p: 62% 18% 14%  6%
 [libx264 @ 0x8088e4b20] ref P L0: 58.4% 17.1% 12.9%  5.8%  5.8%
 [libx264 @ 0x8088e4b20] kb/s:800.16

 }}}
 Duration: 00:21:25.36, start: 0.000000, bitrate: 3157 kb/s
 But it must be 29s!!!
 http://gyazo.com/ba0dbadb3ee6dd3212b51279ab9a89bc - in windows I can see
 meta duration is incorrect but video duration correct :)
 If I try it in player it play but I cant rewind it to some part :(
 It bug some of WMVs file, all ok with MP4 files it in 2.1 and 2.2, all was
 ok in 1.2
 Sorry for my English
 Info from Media Player Classic
 General
 Complete name                  : V:\0003-test-F.1.mp4
 Format                         : MPEG-4
 Format profile                 : Base Media
 Codec ID                       : isom
 File size                      : 2.98 MiB
 Duration                       : 21mn 24s
 Overall bit rate               : 19.5 Kbps
 Writing application            : Lavf55.36.102

 Video
 ID                             : 1
 Format                         : AVC
 Format/Info                    : Advanced Video Codec
 Format profile                 : Baseline at L3.0
 Format settings, CABAC         : No
 Format settings, ReFrames      : 5 frames
 Codec ID                       : avc1
 Codec ID/Info                  : Advanced Video Coding
 Duration                       : 29s 30ms
 Bit rate                       : 800 Kbps
 Nominal bit rate               : 750 Kbps
 Width                          : 640 pixels
 Height                         : 360 pixels
 Display aspect ratio           : 16:9
 Frame rate mode                : Constant
 Frame rate                     : 29.970 fps
 Color space                    : YUV
 Chroma subsampling             : 4:2:0
 Bit depth                      : 8 bits
 Scan type                      : Progressive
 Bits/(Pixel*Frame)             : 0.116
 Stream size                    : 2.77 MiB (93%)
 Writing library                : x264 core 125
 Encoding settings              : cabac=0 / ref=5 / deblock=1:0:0 /
 analyse=0x1:0x111 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 /
 mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 /
 deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=2 /
 lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0
 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 /
 keyint=24 / keyint_min=2 / scenecut=40 / intra_refresh=0 / rc_lookahead=24
 / rc=abr / mbtree=1 / bitrate=750 / ratetol=1.0 / qcomp=0.60 / qpmin=0 /
 qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

 Audio
 ID                             : 2
 Format                         : AAC
 Format/Info                    : Advanced Audio Codec
 Format profile                 : LC
 Codec ID                       : 40
 Duration                       : 29s 24ms
 Duration_LastFrame             : -2ms
 Bit rate mode                  : Constant
 Bit rate                       : 53.2 Kbps
 Channel count                  : 2 channels
 Channel positions              : Front: L R
 Sampling rate                  : 44.1 KHz
 Compression mode               : Lossy
 Stream size                    : 189 KiB (6%)

 Menu #1
 ID                             : 3
 Codec ID                       : text
 Duration                       : 21mn 24s
 Language                       : English

 Menu #2



 Plz help asap

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3537>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list