I have 2 different types of MXF files I'm dealing with. One XDCAM35 and the other is XDCAM50. Both have 4 channels of mono audio. I am trying to figure out a way to demux only the first 2 channels of audio and then combine them into a Stereo WAV file.
My problem lies in the fact that both seem to map the audio in a different way.
The XDCAM35 looks like this...
Stream #0:0: Data: none
file_package_name: Source Package
data_type : vbi_vanc_smpte_436M
Stream #0:1: Video: mpeg2video (Main), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 1
6:9], max. 35000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
file_package_name: Source Package
Stream #0:2: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0:3: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0:4: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0:5: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
and the XDCAM50 looks like this...
Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, bt709), 1920x1080 [SAR 1
:1 DAR 16:9], 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
file_package_name: Source Package
Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
They map the audio on different streams. I'm trying to code a program that will accept an input MXF file, demux only the first 2 channels of audio, and make it into a stereo WAV, which I'll later encode to aac.
Is there an easy way of using ffmpeg to demux the first 2 audio channels assuming it doesn't know the type of file it's expecting beforehand? Or is there a better program that will allow me to do this easier?
+ Reply to Thread
Results 1 to 5 of 5
-
Last edited by nesburf; 8th Jun 2015 at 13:42.
-
You can use map_audio_channel with ffmbc . I think another way is to use -af amerge or pan with ffmpeg using -filter complex
ffmbc -i input_xdcam35.MXF -map_audio_channel 0:2:0:0:0:0 -map_audio_channel 0:3:0:0:0:1 -acodec pcm_s16le output_xdcam35.wav
ffmbc -i input_xdcam50.MXF -map_audio_channel 0:1:0:0:0:0 -map_audio_channel 0:2:0:0:0:1 -acodec pcm_s24le output_xdcam50.wav
The syntax for -map_audio_channel is
Input file : Input stream : Input channel : Output file : Output stream : Output channel
so if you have files with other configurations or stream mappings, just change the numbersLast edited by poisondeathray; 8th Jun 2015 at 13:54.
-
like a 50/50 mix ? probably with -af pan
https://trac.ffmpeg.org/wiki/AudioChannelManipulation#Mixbothstereochannelstostereo
https://ffmpeg.org/ffmpeg-filters.html#pan
Similar Threads
-
Multiple Audio streams bandwidth?
By doomtomb in forum Video Streaming DownloadingReplies: 3Last Post: 10th Apr 2015, 12:38 -
Convert multiple audio streams to MP3
By Meltdown in forum AudioReplies: 2Last Post: 14th Feb 2015, 22:41 -
Including multiple audio streams in rip
By rocks911 in forum DVD RippingReplies: 1Last Post: 9th Dec 2011, 09:39 -
iTunes and multiple audio streams
By TheNomad in forum Video ConversionReplies: 7Last Post: 28th Sep 2010, 15:18 -
Multiple Audio Streams (Avi)
By nycboriqua in forum EditingReplies: 5Last Post: 26th Sep 2010, 17:42