Opened 12 years ago

Closed 12 years ago

#1714 closed defect (fixed)

Wrong video stream chosen when transcoding Movie Maker created wmv files

Reported by: Jernej Virag Owned by:
Priority: important Component: ffmpeg
Version: git-master Keywords: asf regression apic
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

FFMpeg detects a (very short) mjpeg string from within wmv file encoded with Windows Movie Maker which breaks encoding without "-map" parameters.

Test transcode to h.264 output:

ffmpeg started on 2012-09-03 at 21:05:23
Report written to "ffmpeg-20120903-210523.log"
Command line:
"bin\\ffmpeg.exe" -v 9 -loglevel 99 -report -y -i fake_mjpeg_stream.wmv test.mp4
ffmpeg version N-44123-g5d55830 Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep  2 2012 20:27:20 with gcc 4.7.1 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 15.102 /  3. 15.102
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[asf @ 000000000204e9e0] Format asf probed with size=2048 and score=100
[asf @ 000000000204e9e0] gpos mismatch our pos=24, end=26
[asf @ 000000000204e9e0] gpos mismatch our pos=24, end=4096
[asf @ 000000000204e9e0] gpos mismatch our pos=24, end=38
[asf @ 000000000204e9e0] gpos mismatch our pos=24, end=268
[asf @ 000000000204e9e0] gpos mismatch our pos=24, end=38
[asf @ 000000000204e9e0] File position before avformat_find_stream_info() is 56199
[asf @ 000000000204e9e0] parser not found for codec wmav2, packets or times may be invalid.
[wmv3 @ 000000000377afe0] Header: 4FF10001
[wmv3 @ 000000000377afe0] Profile 1:
frmrtq_postproc=7, bitrtq_postproc=31
LoopFilter=0, MultiRes=0, FastUVMC=0, Extended MV=0
Rangered=0, VSTransform=0, Overlap=0, SyncMarker=0
DQuant=0, Quantizer mode=0, Max B frames=0
[wmv3 @ 000000000377afe0] Extra data: 8 bits left, value: 0
[mjpeg @ 0000000003779ae0] marker=d8 avail_size_in_buf=50560
[mjpeg @ 0000000003779ae0] marker parser used 0 bytes (0 bits)
[mjpeg @ 0000000003779ae0] marker=e0 avail_size_in_buf=50558
[mjpeg @ 0000000003779ae0] marker parser used 16 bytes (128 bits)
[mjpeg @ 0000000003779ae0] marker=db avail_size_in_buf=50540
[mjpeg @ 0000000003779ae0] index=0
[mjpeg @ 0000000003779ae0] qscale[0]: 1
[mjpeg @ 0000000003779ae0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0000000003779ae0] marker=db avail_size_in_buf=50471
[mjpeg @ 0000000003779ae0] index=1
[mjpeg @ 0000000003779ae0] qscale[1]: 2
[mjpeg @ 0000000003779ae0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0000000003779ae0] marker=c0 avail_size_in_buf=50402
[mjpeg @ 0000000003779ae0] sof0: picture: 854x480
[mjpeg @ 0000000003779ae0] component 0 2:2 id: 0 quant:0
[mjpeg @ 0000000003779ae0] component 1 1:1 id: 1 quant:1
[mjpeg @ 0000000003779ae0] component 2 1:1 id: 2 quant:1
[mjpeg @ 0000000003779ae0] pix fmt id 22111100
[mjpeg @ 0000000003779ae0] marker parser used 17 bytes (136 bits)
[mjpeg @ 0000000003779ae0] marker=c4 avail_size_in_buf=50383
[mjpeg @ 0000000003779ae0] class=0 index=0 nb_codes=12
[mjpeg @ 0000000003779ae0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0000000003779ae0] marker=c4 avail_size_in_buf=50350
[mjpeg @ 0000000003779ae0] class=1 index=0 nb_codes=251
[mjpeg @ 0000000003779ae0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0000000003779ae0] marker=c4 avail_size_in_buf=50167
[mjpeg @ 0000000003779ae0] class=0 index=1 nb_codes=12
[mjpeg @ 0000000003779ae0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0000000003779ae0] marker=c4 avail_size_in_buf=50134
[mjpeg @ 0000000003779ae0] class=1 index=1 nb_codes=251
[mjpeg @ 0000000003779ae0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0000000003779ae0] escaping removed 251 bytes
[mjpeg @ 0000000003779ae0] marker=da avail_size_in_buf=49951
[mjpeg @ 0000000003779ae0] component: 0
[mjpeg @ 0000000003779ae0] component: 1
[mjpeg @ 0000000003779ae0] component: 2
[mjpeg @ 0000000003779ae0] marker parser used 49699 bytes (397587 bits)
[mjpeg @ 0000000003779ae0] marker=d9 avail_size_in_buf=0
[mjpeg @ 0000000003779ae0] decode frame unused 0 bytes
[asf @ 000000000204e9e0] parser not found for codec wmav2, packets or times may be invalid.
[asf @ 000000000204e9e0] Probe buffer size limit 5000000 reached
[asf @ 000000000204e9e0] Stream #0: not enough frames to estimate rate; consider increasing probesize
rfps: 29.916667 0.017095
rfps: 29.916667 0.017095
rfps: 30.000000 0.005464
rfps: 59.916667 0.003553
rfps: 59.916667 0.003553
rfps: 29.970030 0.000075
rfps: 29.970030 0.000075
rfps: 59.940060 0.000298
rfps: 59.940060 0.000298
[asf @ 000000000204e9e0] File position after avformat_find_stream_info() is 5032637
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, asf, from 'fake_mjpeg_stream.wmv':
  Metadata:
    WMFSDKVersion   : 12.0.7601.17514
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
  Duration: 00:00:37.10, start: 0.000000, bitrate: 2207 kb/s
    Stream #0:0, 1, 1/90000: Video: mjpeg, yuvj420p, 854x480, 1/90000, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Movie/video screen capture
    Stream #0:1(eng), 50, 1/1000: Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, stereo, s16, 192 kb/s
    Stream #0:2(eng), 255, 1/1000: Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 854x480, 1/1000, 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc
[buffer @ 0000000003808e20] Setting entry with key 'video_size' to value '854x480'
[buffer @ 0000000003808e20] Setting entry with key 'pix_fmt' to value '12'
[buffer @ 0000000003808e20] Setting entry with key 'time_base' to value '1/90000'
[buffer @ 0000000003808e20] Setting entry with key 'pixel_aspect' to value '0/1'
[buffer @ 0000000003808e20] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0000000003808e20] Setting entry with key 'frame_rate' to value '90000/1'
[graph 0 input from stream 0:0 @ 0000000003fad740] w:854 h:480 pixfmt:yuvj420p tb:1/90000 fr:90000/1 sar:0/1 sws_param:flags=2
[mp4 @ 00000000037cf700] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
[abuffer @ 00000000037b7ec0] Setting entry with key 'time_base' to value '1/48000'
[abuffer @ 00000000037b7ec0] Setting entry with key 'sample_rate' to value '48000'
[abuffer @ 00000000037b7ec0] Setting entry with key 'sample_fmt' to value 's16'
[abuffer @ 00000000037b7ec0] Setting entry with key 'channel_layout' to value '0x3'
[graph 1 input from stream 0:1 @ 0000000003809d40] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3
[aformat @ 00000000037d0fc0] Setting entry with key 'sample_fmts' to value 's16'
[aformat @ 00000000037d0fc0] Setting entry with key 'sample_rates' to value '96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350'
[libx264 @ 00000000037cfe80] using mv_range_thread = 40
[libx264 @ 00000000037cfe80] MB rate (145800000) > level limit (2073600)
[libx264 @ 00000000037cfe80] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 @ 00000000037cfe80] profile High, level 5.2
[libx264 @ 00000000037cfe80] 264 - core 125 r2208 d9d2288 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test.mp4':
  Metadata:
    WMFSDKVersion   : 12.0.7601.17514
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
    encoder         : Lavf54.25.104
    Stream #0:0, 0, 1/90000: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 854x480, 1/90000, q=-1--1, 90k tbn, 90k tbc
    Metadata:
      comment         : Movie/video screen capture
    Stream #0:1(eng), 0, 1/48000: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> libx264)
  Stream #0:1 -> #0:1 (wmav2 -> libvo_aacenc)
Press [q] to stop, [?] for help
[mjpeg @ 0000000003779ae0] marker=d8 avail_size_in_buf=50560
[mjpeg @ 0000000003779ae0] marker parser used 0 bytes (0 bits)
[mjpeg @ 0000000003779ae0] marker=e0 avail_size_in_buf=50558
[mjpeg @ 0000000003779ae0] marker parser used 16 bytes (128 bits)
[mjpeg @ 0000000003779ae0] marker=db avail_size_in_buf=50540
[mjpeg @ 0000000003779ae0] index=0
[mjpeg @ 0000000003779ae0] qscale[0]: 1
[mjpeg @ 0000000003779ae0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0000000003779ae0] marker=db avail_size_in_buf=50471
[mjpeg @ 0000000003779ae0] index=1
[mjpeg @ 0000000003779ae0] qscale[1]: 2
[mjpeg @ 0000000003779ae0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0000000003779ae0] marker=c0 avail_size_in_buf=50402
[mjpeg @ 0000000003779ae0] sof0: picture: 854x480
[mjpeg @ 0000000003779ae0] component 0 2:2 id: 0 quant:0
[mjpeg @ 0000000003779ae0] component 1 1:1 id: 1 quant:1
[mjpeg @ 0000000003779ae0] component 2 1:1 id: 2 quant:1
[mjpeg @ 0000000003779ae0] pix fmt id 22111100
[mjpeg @ 0000000003779ae0] marker parser used 17 bytes (136 bits)
[mjpeg @ 0000000003779ae0] marker=c4 avail_size_in_buf=50383
[mjpeg @ 0000000003779ae0] class=0 index=0 nb_codes=12
[mjpeg @ 0000000003779ae0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0000000003779ae0] marker=c4 avail_size_in_buf=50350
[mjpeg @ 0000000003779ae0] class=1 index=0 nb_codes=251
[mjpeg @ 0000000003779ae0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0000000003779ae0] marker=c4 avail_size_in_buf=50167
[mjpeg @ 0000000003779ae0] class=0 index=1 nb_codes=12
[mjpeg @ 0000000003779ae0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0000000003779ae0] marker=c4 avail_size_in_buf=50134
[mjpeg @ 0000000003779ae0] class=1 index=1 nb_codes=251
[mjpeg @ 0000000003779ae0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0000000003779ae0] escaping removed 251 bytes
[mjpeg @ 0000000003779ae0] marker=da avail_size_in_buf=49951
[mjpeg @ 0000000003779ae0] component: 0
[mjpeg @ 0000000003779ae0] component: 1
[mjpeg @ 0000000003779ae0] component: 2
[mjpeg @ 0000000003779ae0] marker parser used 49699 bytes (397587 bits)
[mjpeg @ 0000000003779ae0] marker=d9 avail_size_in_buf=0
[mjpeg @ 0000000003779ae0] decode frame unused 0 bytes
[libx264 @ 00000000037cfe80] using mv_range_thread = 40
[libvo_aacenc @ 00000000037d1620] Que input is backward in time
[mp4 @ 00000000037cf700] st:0 PTS: 6544 DTS: 6544 < 7617 invalid, clipping
[mp4 @ 00000000037cf700] st:0 PTS: 7568 DTS: 7568 < 7618 invalid, clipping
[output stream 0:0 @ 000000000380a9a0] EOF on sink link output stream 0:0:default.
[output stream 0:1 @ 000000000380afc0] EOF on sink link output stream 0:1:default.
No more output streams to write to, finishing.
[libx264 @ 00000000037cfe80] frame=   0 QP=30.58 NAL=3 Slice:I Poc:0   I:1620 P:0    SKIP:0    size=6425 bytes
[libvo_aacenc @ 00000000037d1620] Trying to remove 448 more samples than are in the que
frame=    1 fps=0.0 q=33.0 Lsize=     269kB time=00:00:16.30 bitrate= 135.1kbits/s    

video:7kB audio:256kB subtitle:0 global headers:0kB muxing overhead 2.189112%
[libx264 @ 00000000037cfe80] frame I:1     Avg QP:30.58  size:  6425
[libx264 @ 00000000037cfe80] mb I  I16..4: 29.4% 67.3%  3.2%
[libx264 @ 00000000037cfe80] 8x8 transform intra:67.3%
[libx264 @ 00000000037cfe80] coded y,uvDC,uvAC intra: 28.1% 63.3% 7.5%
[libx264 @ 00000000037cfe80] i16 v,h,dc,p: 30% 35%  9% 26%
[libx264 @ 00000000037cfe80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 17% 25%  5%  9%  6%  6%  5%  5%
[libx264 @ 00000000037cfe80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 23% 13%  6%  8%  4%  5%  5%  4%
[libx264 @ 00000000037cfe80] i8c dc,h,v,p: 64% 18% 15%  3%
[libx264 @ 00000000037cfe80] kb/s:4626000.00
[AVIOContext @ 000000000377bfe0] Statistics: 9624828 bytes read, 90 seeks
}}

Change History (3)

comment:1 by Jernej Virag, 12 years ago

A sample file to reproduce the problem with the name of "fake_mjpeg_stream.wmv" was uploaded to ftp://upload.ffmpeg.org/incoming/ .

comment:2 by Carl Eugen Hoyos, 12 years ago

Keywords: asf regression added; wmv removed
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Summary: WMV demuxer detects too many streams in Movie Maker created filesWrong video stream chosen when transcoding Movie Maker created wmv files

Reproducible since b286383 / 5e745ce, work-around is to use -map 0:1 -map 0:2

comment:3 by Michael Niedermayer, 12 years ago

Component: avformatFFmpeg
Keywords: apic added
Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.