Erroneous volume level shifts using ffmpeg to convert AC3 in M2TS to WAV
I using ffmpeg to extract audio from non-commercial bluray m2ts video files, for subsequent loudness analysis in AudioLeak or Dolby Media Meter. The m2ts sometimes have AC3 audio and sometimes have linear PCM audio. I wish to output a WAV file. The command I am using is ffmpeg -i foo.m2ts foo.wav The volume levels of the WAV files are not accurate compared to the corresponding AC3 files. Here's what I mean: If I extract the ac3 audio instead, using ffmpeg -i foo.m2ts -acodec copy -f ac3 foo.ac3 and run both through Dolby Media Meter, the loudness and peak levels of the WAV are shifted up/or down compared to the corresponding AC3 file. And this is happening with AC3 files with a DIALNORM metadata value of -31, which per the Dolby specs, should result in NO volume level change, as -31 is the reference point. Does anyone have any insight into what's going on, or recommendations for a better invocation of ffmpeg? Thanks!
John Pilgrim wrote:
I using ffmpeg to extract audio from non-commercial bluray m2ts video files, for subsequent loudness analysis in AudioLeak or Dolby Media Meter. The m2ts sometimes have AC3 audio and sometimes have linear PCM audio. I wish to output a WAV file. The command I am using is
ffmpeg -i foo.m2ts foo.wav The volume levels of the WAV files are not accurate compared to the corresponding AC3 files.
Here's what I mean: If I extract the ac3 audio instead, using
ffmpeg -i foo.m2ts -acodec copy -f ac3 foo.ac3 and run both through Dolby Media Meter, the loudness and peak levels of the WAV are shifted up/or down compared to the corresponding AC3 file.
And this is happening with AC3 files with a DIALNORM metadata value of -31, which per the Dolby specs, should result in NO volume level change, as -31 is the reference point.
Does anyone have any insight into what's going on, or recommendations for a better invocation of ffmpeg?
By default ac3dec will apply full DRC if there is any there it doesn't use dialnorm by default. To get full range DRC wise do ffmpeg -drc_scale 0 -i foo.m2ts WRT dialnorm - I am not familiar with Dolby s/w, but I think it's possible that some decoders would scale up to a target higher than -31 depending on how they are set - so just because the stream is -31 I am not sure that excludes the possibility that a decoder will adjust - target level is a decoder setting.
Andy Furniss wrote:
WRT dialnorm - I am not familiar with Dolby s/w, but I think it's possible that some decoders would scale up to a target higher than -31 depending on how they are set - so just because the stream is -31 I am not sure that excludes the possibility that a decoder will adjust - target level is a decoder setting.
On this I was mixing up a bit with DVB AAC which does allow for s/w scaling up. I accept that Dolby says -31 is no correction and higher is scaled down - though ffmpeg and I guess other "kit" may cheat a bit and let target levels be set higher and do it in s/w rather than controlling amps.
Thank you Andy! ffmpeg -drc_scale 0 -i foo.m2ts foo.wav worked perfectly and the loudness measurements of the AC3 and WAV extractions now match, as they should. To wit, http://johnpilgrimdesign.com/client/loudness/SCowR25LKFS/#lifeofsock Thanks again, John On Feb 28, 2015, at 3:44 PM, Andy Furniss <adf.lists@gmail.com> wrote:
John Pilgrim wrote:
I using ffmpeg to extract audio from non-commercial bluray m2ts video files, for subsequent loudness analysis in AudioLeak or Dolby Media Meter. The m2ts sometimes have AC3 audio and sometimes have linear PCM audio. I wish to output a WAV file. The command I am using is
ffmpeg -i foo.m2ts foo.wav The volume levels of the WAV files are not accurate compared to the corresponding AC3 files.
Here's what I mean: If I extract the ac3 audio instead, using
ffmpeg -i foo.m2ts -acodec copy -f ac3 foo.ac3 and run both through Dolby Media Meter, the loudness and peak levels of the WAV are shifted up/or down compared to the corresponding AC3 file.
And this is happening with AC3 files with a DIALNORM metadata value of -31, which per the Dolby specs, should result in NO volume level change, as -31 is the reference point.
Does anyone have any insight into what's going on, or recommendations for a better invocation of ffmpeg?
By default ac3dec will apply full DRC if there is any there it doesn't use dialnorm by default.
To get full range DRC wise do
ffmpeg -drc_scale 0 -i foo.m2ts
WRT dialnorm - I am not familiar with Dolby s/w, but I think it's possible that some decoders would scale up to a target higher than -31 depending on how they are set - so just because the stream is -31 I am not sure that excludes the possibility that a decoder will adjust - target level is a decoder setting. _______________________________________________
Hello All, I am having trouble converting ProRes clips into a yuv sequence and back. Here are my commands ffmpeg -i input.mov -c:v rawvideo -pix_fmt yuv422p10le -f image2 -s 1920x1080 %05d.yuv ffmpeg -f image2 -c:v rawvideo -pix_fmt yuv422p10le -s 1920x1080 -i %05d.yuv -r 23.976 -c:v prores out.mov Any suggestion on why this is creating visual gray shaded blocks on top of the video? Thanks Markus
<loeffler <at> eyetrap.net> writes:
ffmpeg -i input.mov -c:v rawvideo -pix_fmt yuv422p10le -f image2 -s 1920x1080 %05d.yuv
Complete, uncut console output missing. (both commands)
ffmpeg -f image2 -c:v rawvideo -pix_fmt yuv422p10le -s 1920x1080 -i %05d.yuv -r 23.976 -c:v prores out.mov
-r looks wrong, you probably want to use -framerate 24000/1001 in front of "-i". For future questions, please understand that thread hijacking is considered rude everywhere. Carl Eugen
I have the full console output pasted at the end, here the original question: I am having trouble converting ProRes clips into a yuv sequence and back. ############## 1) decoding into yuv sequence: ffmpeg version 2.5.git Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree libavutil 54. 18.100 / 54. 18.100 libavcodec 56. 21.102 / 56. 21.102 libavformat 56. 19.101 / 56. 19.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 10.100 / 5. 10.100 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/control/video/40-042731-ProResHDFormatSample.mov': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt creation_time : 2010-01-31 01:22:31 timecode : 04:27:15:13 Duration: 00:00:06.30, start: 0.000000, bitrate: 174592 kb/s Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709), 1920x1080, 174578 kb/s, 23.98 fps, 23.98 tbr, 2997 tbn, 2997 tbc (default) Metadata: creation_time : 2010-01-31 01:22:31 handler_name : Apple Video Media Handler encoder : Apple ProRes 422 (HQ) Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default) Metadata: creation_time : 2010-01-31 01:22:47 handler_name : Time Code Media Handler reel_name : 001 timecode : 04:27:15:13 Output #0, image2, to '/home/control/video/LAS/%05d.yuv': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt timecode : 04:27:15:13 encoder : Lavf56.19.101 Stream #0:0(eng): Video: rawvideo (Y42B / 0x42323459), yuv422p, 1920x1080, q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default) Metadata: creation_time : 2010-01-31 01:22:31 handler_name : Apple Video Media Handler encoder : Lavc56.21.102 rawvideo Stream mapping: Stream #0:0 -> #0:0 (prores (native) -> rawvideo (native)) Press [q] to stop, [?] for help frame= 151 fps= 65 q=0.0 Lsize=N/A time=00:00:06.29 bitrate=N/A video:611550kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown ############## 2) and back from yuv sequence into mov file: ffmpeg version 2.5.git Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree libavutil 54. 18.100 / 54. 18.100 libavcodec 56. 21.102 / 56. 21.102 libavformat 56. 19.101 / 56. 19.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 10.100 / 5. 10.100 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 Input #0, image2, from '/home/control/video/LASwm/%05d.yuv': Duration: 00:00:06.04, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo (Y42B / 0x42323459), yuv422p, 1920x1080, 25 tbr, 25 tbn, 25 tbc [prores @ 0x2621a20] encoding with ProRes standard (apcn) profile [prores @ 0x26425c0] encoding with ProRes standard (apcn) profile [prores @ 0x2650220] encoding with ProRes standard (apcn) profile [prores @ 0x2654d80] encoding with ProRes standard (apcn) profile [prores @ 0x26598e0] encoding with ProRes standard (apcn) profile [prores @ 0x265e440] encoding with ProRes standard (apcn) profile [prores @ 0x2662fa0] encoding with ProRes standard (apcn) profile [prores @ 0x2667b00] encoding with ProRes standard (apcn) profile [prores @ 0x266c660] encoding with ProRes standard (apcn) profile [prores @ 0x2671460] encoding with ProRes standard (apcn) profile [prores @ 0x2676260] encoding with ProRes standard (apcn) profile [prores @ 0x267b060] encoding with ProRes standard (apcn) profile [prores @ 0x267fe60] encoding with ProRes standard (apcn) profile [prores @ 0x2684c60] encoding with ProRes standard (apcn) profile [prores @ 0x2689a60] encoding with ProRes standard (apcn) profile [prores @ 0x268e860] encoding with ProRes standard (apcn) profile [prores @ 0x2693660] encoding with ProRes standard (apcn) profile [prores @ 0x2698460] encoding with ProRes standard (apcn) profile [prores @ 0x269d260] encoding with ProRes standard (apcn) profile [prores @ 0x26a2060] encoding with ProRes standard (apcn) profile [prores @ 0x26a6e60] encoding with ProRes standard (apcn) profile [prores @ 0x26abc60] encoding with ProRes standard (apcn) profile [prores @ 0x26b0a60] encoding with ProRes standard (apcn) profile [prores @ 0x26b5860] encoding with ProRes standard (apcn) profile [prores @ 0x2630fe0] encoding with ProRes standard (apcn) profile Output #0, mov, to '/home/control/video/40-042731-ProResHDFormatSample_wm.mov': Metadata: encoder : Lavf56.19.101 Stream #0:0: Video: prores (apcn) (apcn / 0x6E637061), yuv422p10le, 1920x1080, q=2-31, 200 kb/s, 23.98 fps, 11988 tbn, 23.98 tbc Metadata: encoder : Lavc56.21.102 prores Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> prores (native)) Press [q] to stop, [?] for help Past duration 0.614388 too large Past duration 0.655357 too large Past duration 0.696312 too large Past duration 0.737267 too large Past duration 0.778236 too large Past duration 0.819191 too large Past duration 0.860146 too large Past duration 0.901115 too large Past duration 0.942070 too large Past duration 0.983040 too large frame= 146 fps= 86 q=0.0 Lsize= 129291kB time=00:00:06.08 bitrate=173932.4kbits/s dup=0 drop=5 video:129289kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001428% Quoting Carl Eugen Hoyos <cehoyos@ag.or.at>:
<loeffler <at> eyetrap.net> writes:
ffmpeg -i input.mov -c:v rawvideo -pix_fmt yuv422p10le -f image2 -s 1920x1080 %05d.yuv
Complete, uncut console output missing. (both commands)
ffmpeg -f image2 -c:v rawvideo -pix_fmt yuv422p10le -s 1920x1080 -i %05d.yuv -r 23.976 -c:v prores out.mov
-r looks wrong, you probably want to use -framerate 24000/1001 in front of "-i".
For future questions, please understand that thread hijacking is considered rude everywhere.
Carl Eugen
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
participants (4)
-
Andy Furniss -
Carl Eugen Hoyos -
John Pilgrim -
loeffler@eyetrap.net