[FFmpeg-user] verifying losslessness after merging two mono tracks into single stereo track

Kieran O'Leary kieran.oleary at irishfilm.ie
Wed Sep 18 15:07:45 EEST 2019


I am very sorry  - Outlook Web App sent the email when I tried to copy paste the command - also it won't let me bottom post! i promise that future emails will be in the correct format.

This is the command I used to do a one second test where the intention is to merge two mono audio tracks into one stereo track - i was hoping that there was a way to do this without a filter but i guess not?:
ffmpeg -i "input.mov"  -filter_complex "
[0:2][0:3]join=inputs=2:channel_layout=stereo[a]" -map "[a]"  -c:a pcm_s24le -c:
v copy -t 1 output.mov
ffmpeg version N-92623-g2c64a6bcd2 Copyright (c) 2000-2018 the FFmpeg developers

  built with gcc 8.2.1 (Rev1, Built by MSYS2 project) 20181130
  configuration:  --disable-autodetect --enable-amf --enable-bzlib --enable-cuda
 --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --e
nable-nvenc --enable-zlib --enable-sdl2 --disable-debug --enable-ffnvcodec --ena
ble-nvdec --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvp
x --enable-libx264 --enable-libx265 --enable-libdav1d --enable-fontconfig --enab
le-libass --enable-libbluray --enable-libfreetype --enable-libmfx --enable-libmy
sofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enabl
e-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwavpack --e
nable-libwebp --enable-libxml2 --enable-libzimg --enable-libshine --enable-gpl -
-enable-avisynth --enable-libxvid --enable-libaom --enable-version3 --enable-chr
omaprint --enable-decklink --enable-frei0r --enable-libbs2b --enable-libcaca --e
nable-libcdio --enable-libfdk-aac --enable-libflite --enable-libfribidi --enable
-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmodplug
 --enable-libopenh264 --enable-libopenmpt --enable-librtmp --enable-librubberban
d --enable-libssh --enable-libtesseract --enable-libxavs --enable-libzmq --enabl
e-libzvbi --enable-opencl --enable-opengl --enable-libvmaf --enable-libcodec2 --
enable-libsrt --enable-ladspa --enable-openssl --extra-cflags=-fopenmp --extra-l
ibs=-lgomp --extra-cflags=-DLIBTWOLAME_STATIC --extra-libs=-lstdc++ --extra-cfla
gs=-DLIBSSH_STATIC --extra-ldflags='-Wl,--allow-multiple-definition' --extra-cfl
ags=-DCACA_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCHROMAPRINT_N
ODLL --extra-libs=-lstdc++ --extra-cflags=-DZMQ_STATIC --extra-libs=-lpsapi --ex
tra-cflags=-DLIBXML_STATIC --extra-libs=-liconv --disable-w32threads --extra-cfl
ags=-DKVZ_STATIC_LIB --enable-nonfree
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 41.101 / 58. 41.101
  libavformat    58. 23.102 / 58. 23.102
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mov':
  Metadata:
    creation_time   : 2019-09-18T09:27:36.000000Z
  Duration: 01:37:57.56, start: 0.000000, bitrate: 223490 kb/s
    Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le(smpte170m/bt4
70bg/bt709, top coded first (swapped)), 720x576, 221184 kb/s, SAR 16:15 DAR 4:3,
 25 fps, 25 tbr, 25k tbn, 25k tbc (default)
    Metadata:
      creation_time   : 2019-09-18T09:27:36.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : 10 bit YCbCr
      timecode        : 00:58:04:15
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2019-09-18T09:27:36.000000Z
      handler_name    : Time Code Media Handler
      reel_name       : Untitled
      timecode        : 00:58:04:15
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32
(24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2019-09-18T09:27:36.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32
(24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2019-09-18T09:27:36.000000Z
      handler_name    : Apple Sound Media Handler
File 'output.mov' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:2 (pcm_s24le) -> join:input0
  Stream #0:3 (pcm_s24le) -> join:input1
  join -> Stream #0:0 (pcm_s24le)
Press [q] to stop, [?] for help
Output #0, mov, to 'output.mov':
  Metadata:
    encoder         : Lavf58.23.102
    Stream #0:0: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 23
04 kb/s (default)
    Metadata:
      encoder         : Lavc58.41.101 pcm_s24le
size=     282kB time=00:00:01.00 bitrate=2309.9kbits/s speed=41.1x
video:0kB audio:281kB subtitle:0kB other streams:0kB global headers:0kB muxing o
verhead: 0.256944%

What is the best way to verify that the process was lossless?

I tried the following which seems very clumsy:
1. Export the two original audio tracks as seperate wav files with  (i know i could have done it in one command but I just knocked this together)
ffmpeg -i input.mov -c:a copy -t 1 -map 0:2  left.wav
ffmpeg -i input.mov -c:a copy -t 1 -map 0:3  right.wav

2. Export the new output.mov with the single stereo track as a WAV, then used the following to make seperate tracks out of the channels: with ffmpeg -i output.mov -c:a pcm_s24le -map_channel 0.0.0 left_merge.wav -c:a pcm_s24le -map_channel 0.0.1 right_merge.wav

3. Use framemd5s to compare the various wavs to make sure that the same samples are produced in the source and output.

The framemd5s were indeed identical aside from the last sample, which may have had something to do with trimming at 1 second.

is there an easier way to verify that the same audio is produced in the source  audio files as with the merged stereo track?

Best,

Kieran.





------
This email has been scanned for spam and malware by The Email Laundry.




More information about the ffmpeg-user mailing list