Monomix left audio

Questions involving a Windows version of FFmpeg.
Post Reply
chr57
Posts: 5
Joined: Fri Mar 22, 2019 1:20 pm

Monomix left audio

Post by chr57 » Mon Mar 25, 2019 10:32 am

Having this string below to generate 4 different outputs.
How do I take the left audio and copy it to the right = mono mix left audio?
It is the same audio for all outputs som should be nice to apply the same to all outputs.

Suppose that I could use something like "[0:a]amerge=inputs=1[a]" in the filter_complex but don't understand how to implement it?

Code: Select all

ffmpeg -i lopp.mxf -y -threads 0 -filter_complex "[0:v]format=yuv420p, yadif=1, split=4[s0][s1][s2][s3]; [s0]scale=384:216[v0]; [s1]scale=512:288[v1]; [s2]scale=768:432[v2]; [s3]scale=1920:1080[v3]" -map "[v0]" -map "[v1]" -map "[v2]" -map "[v3]" -c:v h264 -preset medium -framerate 25 -crf 18 copy -af aac -b:a 192K -b:v:0 0.5M -b:v:1 1M -b:v:2 1.5M -b:v:3 4.5M -f tee "[select=\'v:0,a\']248x216.mp4|[select=\'v:1,a\']512x288.mp4|[select=\'v:2,a\']768x432.mp4|[select=\'v:3,a\']1920x1080.mp4"

pandy
Posts: 255
Joined: Mon Feb 24, 2014 1:46 pm

Re: Monomix left audio

Post by pandy » Mon Mar 25, 2019 10:46 am

You may follow example here:
https://trac.ffmpeg.org/wiki/AudioChann ... monostereo

But this can be done in many ways.

For example with help of:
https://ffmpeg.org/ffmpeg-filters.html#pan-1

chr57
Posts: 5
Joined: Fri Mar 22, 2019 1:20 pm

Re: Monomix left audio

Post by chr57 » Mon Mar 25, 2019 11:16 am

Do I have to add it to the filter_complex and then map it to just remap the audio once for all channels?
Can you give me an example of how the string could look like?

pandy
Posts: 255
Joined: Mon Feb 24, 2014 1:46 pm

Re: Monomix left audio

Post by pandy » Mon Mar 25, 2019 11:31 am

not tested, never made something like this before (-af aac replaced by -c:a aac , IMHO it was error)

Code: Select all

ffmpeg -i lopp.mxf -y -threads 0 -filter_complex "[0:v]format=yuv420p, yadif=1, split=4[s0][s1][s2][s3]; [s0]scale=384:216[v0]; [s1]scale=512:288[v1]; [s2]scale=768:432[v2]; [s3]scale=1920:1080[v3];[0:a][0:a]amerge=inputs=2[a]" -map "[v0]" -map "[v1]" -map "[v2]" -map "[v3]" -c:v h264 -preset medium -framerate 25 -crf 18 copy -map "[a]" -c:a aac -b:a 192K -b:v:0 0.5M -b:v:1 1M -b:v:2 1.5M -b:v:3 4.5M -f tee "[select=\'v:0,a\']248x216.mp4|[select=\'v:1,a\']512x288.mp4|[select=\'v:2,a\']768x432.mp4|[select=\'v:3,a\']1920x1080.mp4"
With pan it should be like this:

Code: Select all

ffmpeg -i lopp.mxf -y -threads 0 -filter_complex "[0:v]format=yuv420p, yadif=1, split=4[s0][s1][s2][s3]; [s0]scale=384:216[v0]; [s1]scale=512:288[v1]; [s2]scale=768:432[v2]; [s3]scale=1920:1080[v3];[0:a]pan=stereo|FL=c0|FR=c0[a]" -map "[v0]" -map "[v1]" -map "[v2]" -map "[v3]" -c:v h264 -preset medium -framerate 25 -crf 18 copy -map "[a]" -c:a aac -b:a 192K -b:v:0 0.5M -b:v:1 1M -b:v:2 1.5M -b:v:3 4.5M -f tee "[select=\'v:0,a\']248x216.mp4|[select=\'v:1,a\']512x288.mp4|[select=\'v:2,a\']768x432.mp4|[select=\'v:3,a\']1920x1080.mp4"
proper quoting may be required

chr57
Posts: 5
Joined: Fri Mar 22, 2019 1:20 pm

Re: Monomix left audio

Post by chr57 » Mon Mar 25, 2019 2:57 pm

Thanks, sad that it generates an error: Unable to find a suitable output format for 'copy' :?

Code: Select all

ffmpeg -i lopp.mxf -y -threads 0 -filter_complex "[0:v]format=yuv420p, yadif=1, split=4[s0][s1][s2][s3]; [s0]scale=384:216[v0]; [s1]scale=512:288[v1]; [s2]scale=768:432[v2]; [s3]scale=1920:1080[v3];[0:a][0:a]amerge=inputs=2[a]" -map "[v0]" -map "[v1]" -map "[v2]" -map "[v3]" -c:v h264 -preset medium -framerate 25 -crf 18 copy -map "[a]" -c:a aac -b:a 192K -b:v:0 0.5M -b:v:1 1M -b:v:2 1.5M -b:v:3 4.5M -f tee "[select=\'v:0,a\']248x216.mp4|[select=\'v:1,a\']512x288.mp4|[select=\'v:2,a\']768x432.mp4|[select=\'v:3,a\']1920x1080.mp4"

pandy
Posts: 255
Joined: Mon Feb 24, 2014 1:46 pm

Re: Monomix left audio

Post by pandy » Mon Mar 25, 2019 3:44 pm

chr57 wrote:
Mon Mar 25, 2019 2:57 pm
Thanks, sad that it generates an error: Unable to find a suitable output format for 'copy' :?

ffmpeg -i lopp.mxf -y -threads 0 -filter_complex "[0:v]format=yuv420p, yadif=1, split=4[s0][s1][s2][s3]; [s0]scale=384:216[v0]; [s1]scale=512:288[v1]; [s2]scale=768:432[v2]; [s3]scale=1920:1080[v3];[0:a][0:a]amerge=inputs=2[a]" -map "[v0]" -map "[v1]" -map "[v2]" -map "[v3]" -c:v h264 -preset medium -framerate 25 -crf 18 copy -map "[a]" -c:a aac -b:a 192K -b:v:0 0.5M -b:v:1 1M -b:v:2 1.5M -b:v:3 4.5M -f tee "[select=\'v:0,a\']248x216.mp4|[select=\'v:1,a\']512x288.mp4|[select=\'v:2,a\']768x432.mp4|[select=\'v:3,a\']1920x1080.mp4"

Post Reply
'