Hi I have a .bat file to convert and change channel volume levels (with ffmpeg) from 5.1 Audio to Stereo, and a different .bat for Stereo/Mono Audio that doesn't change loudness.
Now I have to manually look if a movie is 5.1 or Mono/Stereo and decide which .bat to run. I would like to make one .bat with a condition so it looks what the channel layout for a specific language is and then decide which profile to run. I hope this makes sense. It has to check also the language tag, because sometimes (in my case) german is 2.0 but English is 5.1 or vice versa.
From my understanding I would need ffprobe which gives me the channel count and language for every audio track
So I have kinda all the pieces but I don't know how to put them together in a .bat scriptCode:ffprobe -i %~1 -v error -select_streams a -of csv=p=0 -show_entries stream=channels,index:stream_tags=language
Thank you for any advice
Profile A: 5.1
Profile B: Stereo/MonoCode:ffmpeg ^ -i "%~1" ^ -af "pan=stereo|c0=c2+0.6*c0+0.6*c4+c3|c1=c2+0.6*c1+0.6*c5+c3" -map 0:v:0 -c:v copy -map 0:a:m:language:ger -codec:a ac3 -b:a 160k -ar 44100 -sn -dn ^ "G:\%~n1.mkv"
Code:ffmpeg ^ -i "%~1" ^ -map 0:v:0 -c:v copy -map 0:a:m:language:ger -codec:a ac3 -b:a 160k -ar 44100 -sn -dn ^ "G:\%~n1.mkv" This is the whole .batCode:@echo off :again ffmpeg ^ -i "%~1" ^ -map 0:v:0 -c:v copy -map 0:a:m:language:ger -codec:a ac3 -b:a 160k -ar 44100 -sn -dn ^ "G:\%~n1.mkv" if NOT ["%errorlevel%"]==["0"] goto:error echo [92m%~n1 Done
I don't know what "using esc codes to change screen colours" means. all the credit goes to the author from github (github.com/L0Lock/FFmpeg-bat-collection) I just found his .bat scripts and started to build in my own commands ^^
@hello_hello you are right all the audio is usually 48k but my tv (usb) has real problems, and often glitches the video and audio streams so I started to make the audio as small as possible
Similar Threads
-
convert ffmpeg bat file to Linux shell script
By wiseant in forum LinuxReplies: 4Last Post: 2nd Sep 2023, 19:25 -
images to mkv and webp by using ffmpeg into a .bat file
By maudit in forum Video ConversionReplies: 2Last Post: 15th Aug 2023, 03:17 -
FFMpeg Auto output Name on .bat Script file
By Daringbaaz in forum Newbie / General discussionsReplies: 10Last Post: 6th Dec 2020, 09:44 -
ffmpeg in bat file
By windranger in forum Video ConversionReplies: 5Last Post: 25th Jul 2020, 03:27 -
ffmpeg bat to mux multible audio and video
By alkoon in forum Newbie / General discussionsReplies: 3Last Post: 5th Jun 2020, 12:20



Quote