Selur
11th December 2010, 12:03
I did the following:
1. Extract ac3 audio:
mplayer -v -mc 0 -vc dummy -nocorrect-pts -aid 128 dvd://1 -dvd-device "D:\ElephantsDream\VIDEO_TS" -chapter 1-1 -dumpaudio -dumpfile "D:\Encoding Output\audio.ac3"
2. Xvid 1stPass:
mencoder -dvd-device "D:\ElephantsDream\VIDEO_TS" dvd://1 -chapter 1-1 -noskip -vc mpeg12 -vf scale,format=i420 -forcedsubsonly -noautosub -nosound -mc 0 -lavdopts threads=8 -fps 25 -aspect 1.7775:1 -ovc xvid -xvidencopts pass=1:bitrate=8776:turbo:profile=unrestricted:me_quality=6:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:max_key_interval=250:quant_type=h263:max_bframes=2:bquant_ratio=150:bquant_offset=100:bf_threshold=0:vhq=2:bvhq=1:curve_compression_high=0:curve_compression_low=0:overflow_control_strength=10:max_overflow_improvement=10:max_overflow_degradation=10:trellis:noqpel:nogmc:nocartoon:chroma_opt:chroma_me:nointerlacing:keyframe_boost=10:kfthreshold=1:kfreduction=20:par=ext:par_width=16:par_height=11:closed_gop:nopacked:threads=0 -passlogfile "D:\Encoding Output\StatFile.stats" -o NUL
3. Xvid 2nd Pass:
mencoder -dvd-device "D:\ElephantsDream\VIDEO_TS" dvd://1 -chapter 1-1 -noskip -vc mpeg12 -vf scale,format=i420 -forcedsubsonly -noautosub -nosound -mc 0 -lavdopts threads=8 -fps 25 -aspect 1.7775:1 -ovc xvid -xvidencopts pass=2:bitrate=8776:profile=unrestricted:me_quality=6:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:max_key_interval=250:quant_type=h263:max_bframes=2:bquant_ratio=150:bquant_offset=100:bf_threshold=0:vhq=2:bvhq=1:curve_compression_high=0:curve_compression_low=0:overflow_control_strength=10:max_overflow_improvement=10:max_overflow_degradation=10:trellis:noqpel:nogmc:nocartoon:chroma_opt:chroma_me:nointerlacing:keyframe_boost=10:kfthreshold=1:kfreduction=20:par=ext:par_width=16:par_height=11:closed_gop:nopacked:threads=0 -passlogfile "D:\Encoding Output\StatFile.stats" -of rawvideo -o "D:\Encoding Output\video.m4v"
4. delete "D:\Encoding Output\StatFile.stats" Datei
Here comes the problem.
5. Audio&Video multiplexing:
ffmpeg -y -i "D:\Encoding Output\video.m4v" -i "D:\Encoding Output\audio.ac3" -vcodec copy -acodec copy -map 0:0 -map 1:0 "D:\Encoding Output\test.avi"
or
ffmpeg -y -i "D:\Encoding Output\video.m4v" -i "D:\Encoding Output\audio.ac3" -vcodec copy -acodec copy "D:\Encoding Output\test.avi"
-> Audio seems to be broken and File length equals audio + video length; video plays fine
Since the audio plays fine and mediainfo "D:\Encoding Output\audio.ac3" doesn't show any problems:
General
Complete name : D:\Encoding Output\audio.ac3
Format : AC-3
Format/Info : Audio Coding 3
File size : 1.41 MiB
Duration : 26s 368ms
Overall bit rate : 448 Kbps
Audio
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Duration : 26s 368ms
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 1.41 MiB (100%) I assume, the audio is okay and the problem lies with the muxing call.
Seems like ffmpeg chooses a wrong audio codec id during muxing:
MediaInfo.exe "d:\Encoding Output\test.avi"
General
Complete name : d:\Encoding Output\test.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 13.3 MiB
Duration : 26s 520ms
Overall bit rate : 4 192 Kbps
Writing application : Lavf52.87.1
Video
ID : 0
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : FMP4
Duration : 26s 520ms
Bit rate : 3 732 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.360
Stream size : 11.8 MiB (89%)
Writing library : XviD 1.2.1 (UTC 2008-12-04)
Audio
ID : 1
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : 00001000-0000-0020-8000-00AA00389B71]
Duration : 26s 400ms
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 1.41 MiB (11%)
Interleave, duration : 32 ms (0.80 video frame)
For reproduction I uploaded (http://selur.bplaced.net/test.zip) (ca. 13MB) the video.m4v and audio.ac3.
Does anyone know if this is a ffmpeg bug, if my muxing call is broken or if I went wrong somewhere else?
Cu Selur
1. Extract ac3 audio:
mplayer -v -mc 0 -vc dummy -nocorrect-pts -aid 128 dvd://1 -dvd-device "D:\ElephantsDream\VIDEO_TS" -chapter 1-1 -dumpaudio -dumpfile "D:\Encoding Output\audio.ac3"
2. Xvid 1stPass:
mencoder -dvd-device "D:\ElephantsDream\VIDEO_TS" dvd://1 -chapter 1-1 -noskip -vc mpeg12 -vf scale,format=i420 -forcedsubsonly -noautosub -nosound -mc 0 -lavdopts threads=8 -fps 25 -aspect 1.7775:1 -ovc xvid -xvidencopts pass=1:bitrate=8776:turbo:profile=unrestricted:me_quality=6:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:max_key_interval=250:quant_type=h263:max_bframes=2:bquant_ratio=150:bquant_offset=100:bf_threshold=0:vhq=2:bvhq=1:curve_compression_high=0:curve_compression_low=0:overflow_control_strength=10:max_overflow_improvement=10:max_overflow_degradation=10:trellis:noqpel:nogmc:nocartoon:chroma_opt:chroma_me:nointerlacing:keyframe_boost=10:kfthreshold=1:kfreduction=20:par=ext:par_width=16:par_height=11:closed_gop:nopacked:threads=0 -passlogfile "D:\Encoding Output\StatFile.stats" -o NUL
3. Xvid 2nd Pass:
mencoder -dvd-device "D:\ElephantsDream\VIDEO_TS" dvd://1 -chapter 1-1 -noskip -vc mpeg12 -vf scale,format=i420 -forcedsubsonly -noautosub -nosound -mc 0 -lavdopts threads=8 -fps 25 -aspect 1.7775:1 -ovc xvid -xvidencopts pass=2:bitrate=8776:profile=unrestricted:me_quality=6:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:max_key_interval=250:quant_type=h263:max_bframes=2:bquant_ratio=150:bquant_offset=100:bf_threshold=0:vhq=2:bvhq=1:curve_compression_high=0:curve_compression_low=0:overflow_control_strength=10:max_overflow_improvement=10:max_overflow_degradation=10:trellis:noqpel:nogmc:nocartoon:chroma_opt:chroma_me:nointerlacing:keyframe_boost=10:kfthreshold=1:kfreduction=20:par=ext:par_width=16:par_height=11:closed_gop:nopacked:threads=0 -passlogfile "D:\Encoding Output\StatFile.stats" -of rawvideo -o "D:\Encoding Output\video.m4v"
4. delete "D:\Encoding Output\StatFile.stats" Datei
Here comes the problem.
5. Audio&Video multiplexing:
ffmpeg -y -i "D:\Encoding Output\video.m4v" -i "D:\Encoding Output\audio.ac3" -vcodec copy -acodec copy -map 0:0 -map 1:0 "D:\Encoding Output\test.avi"
or
ffmpeg -y -i "D:\Encoding Output\video.m4v" -i "D:\Encoding Output\audio.ac3" -vcodec copy -acodec copy "D:\Encoding Output\test.avi"
-> Audio seems to be broken and File length equals audio + video length; video plays fine
Since the audio plays fine and mediainfo "D:\Encoding Output\audio.ac3" doesn't show any problems:
General
Complete name : D:\Encoding Output\audio.ac3
Format : AC-3
Format/Info : Audio Coding 3
File size : 1.41 MiB
Duration : 26s 368ms
Overall bit rate : 448 Kbps
Audio
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Duration : 26s 368ms
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 1.41 MiB (100%) I assume, the audio is okay and the problem lies with the muxing call.
Seems like ffmpeg chooses a wrong audio codec id during muxing:
MediaInfo.exe "d:\Encoding Output\test.avi"
General
Complete name : d:\Encoding Output\test.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 13.3 MiB
Duration : 26s 520ms
Overall bit rate : 4 192 Kbps
Writing application : Lavf52.87.1
Video
ID : 0
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : FMP4
Duration : 26s 520ms
Bit rate : 3 732 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.360
Stream size : 11.8 MiB (89%)
Writing library : XviD 1.2.1 (UTC 2008-12-04)
Audio
ID : 1
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : 00001000-0000-0020-8000-00AA00389B71]
Duration : 26s 400ms
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 1.41 MiB (11%)
Interleave, duration : 32 ms (0.80 video frame)
For reproduction I uploaded (http://selur.bplaced.net/test.zip) (ca. 13MB) the video.m4v and audio.ac3.
Does anyone know if this is a ffmpeg bug, if my muxing call is broken or if I went wrong somewhere else?
Cu Selur