HI everybody,
I use a blackmagic hyperdeck to record videos which i later transcode.
I record 4 channels of PCM241le in one only stream with the video.
I use ffmpeg for my transcoding and for the video part it is working as I expect.
But I can't find the solution for the audio stream:
I want to separate that PCM 4channels stream into several stereo+mono aac streams, so that I can see the separate streams in VLC (in the menu where you can choose which audio track you want to play)
Exactly, I want the first 2 channels to be L/R of a stereo stream, and channel 3 to be a second stream in mono, and get rid of channel 4
If I just do ffmpeg -i test.mp4 -c:v copy -c:a aac output.mp4 obviously it gives one aac stream with 4channels, which is not what I want.
This is what ffprobe gives me for that PCM stream:
Stream #0:2[0x3](eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 4 channels, s32 (24 bit), 4608 kb/s (default)
Metadata:
creation_time : 2025-03-02T16:44:43.000000Z
handler_name : ?Apple Sound Media Handler
vendor_id : [0][0][0][0]
timecode : 17:44:43:43
Thank you in advance for your help!!
+ Reply to Thread
Results 1 to 6 of 6
-
Last edited by Opera59; 11th Mar 2025 at 09:29.
-
Edit:
When I try to find the channel layout with ffprobe -show_entries stream=channel_layout
It returns that the channel layout is unknown
And this is what I get with ffprobe -v error -show_frames -select_streams a:0
[FRAME]
media_type=audio
stream_index=2
key_frame=1
pts=0
pts_time=0.000000
pkt_dts=0
pkt_dts_time=0.000000
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
duration=1024
duration_time=0.021333
pkt_pos=1983416
pkt_size=12288
sample_fmt=s32
nb_samples=1024
channels=4
channel_layout=unknown -
You can do it with clever FFmpeg-GUI
1st) Load your video with the 4 channels pcm audiostream.
Click main page, then click encode audio stream.
Select your 4 channels pcm stream (if there are other audiostreams), then set channels to split channels.
Click split.
This gives you 4 mono pcm files.
2) Return to encode audio stream, set channels to join channels.
Drag channel1 and channel2 into the grid and click join.
This gives you a new pcm stereo file.
3) Return to source, load this new pcm stereo file, click main page, click encode audio stream, set aac as encoder, make your other settings and click encode.
This gives you a new aac stereo file.
4) Repeat step 3 with the other pcm mono files. -
THanks a lot Prowo for your answer!
This solution will surely work but I can't go that way for several reasons:
i have to work with FFMPEG inside shell scripts because of my already setup workflow.
Everything is automated with watch folders, actions and batch transcoding. I would not be possible to do those steps manually.
I wish I could do it by adding code to my ffmpeg command line.
I have discovered more infos that maybe will give clues:
Using FFWorks (formerly IFFMPEG, I'm on mac btw) I have managed to get the channel layout for this 4.0 PCM stream, it is FL+FR+FC+BC
Could I use something like -map or-channel split, or other ffmpeg function to get audio aac stream one stereo (with FL+FR) and aac stream 2 in mono with FC . I don't need the BC channel which is blank
So I would get:
#0:0 video
#0:1 aac stereo (FL+FR)
#0:2 aac mono (FC)Last edited by Opera59; 12th Mar 2025 at 04:37.
-
Read this and make your own commandline.
https://trac.ffmpeg.org/wiki/AudioChannelManipulation
Similar Threads
-
Possible to send 12 channels of PCM from Mac to AVR via hdmi 2.x? Ffmpeg?
By Muon in forum AudioReplies: 7Last Post: 15th Jan 2022, 12:22 -
Premiere CC 2019 and importing 5.1 audio as 6 mono channels
By Stile in forum EditingReplies: 0Last Post: 20th Apr 2021, 16:01 -
PCM to AAC conversion (avidemux) (specs inside)
By Anon11009 in forum AudioReplies: 0Last Post: 26th Aug 2020, 02:26 -
Ridiculously difficult to convert an aac to 6 mono wavs
By takearushfan in forum AudioReplies: 9Last Post: 29th Jul 2020, 14:03 -
PotPlayer SPDIF AAC AC3 DTS PCM
By blopblop in forum Software PlayingReplies: 12Last Post: 16th Mar 2020, 05:05