0

I'm trying to get ffmpeg to output separate audio and video files in 1 command.

Here are the 2 commands I have:

ffmpeg -ss 04:53 -i ./07.mkv -t 3 -c:v libx264 -crf 18 -filter:v "setpts=PTS-STARTPTS, crop=960:720, scale=480:360" -an -sws_flags lanczos -fflags +genpts 07-alexFlex.mp4
ffmpeg -ss 04:53 -i ./07.mkv -t 3 07-alexFlex.mp3

Is there a way to get it in 1 command? Ideally both the audio and video files would share the same name automatically without me changing it twice in both commands. Thanks.

1

Daisychain the commands, so

ffmpeg -ss 04:53 -i ./07.mkv -t 3 -c:v libx264 -crf 18 -filter:v "setpts=PTS-STARTPTS, crop=960:720, scale=480:360" -an -sws_flags lanczos -fflags +genpts 07-alexFlex.mp4 -ss 04:53 -i ./07.mkv -t 3 07-alexFlex.mp3 
  • Is there any way to set variables so that the file names could be copied? Like 07-alexFlex. – Harry Nov 14 '15 at 5:57
  • Sure, with simple shell scripting. It's been years since I used Linux but bash scripts should work. See developer.apple.com/library/mac/documentation/OpenSource/… - I'm sure someone will come along and provide the specific script for your current use case. – Gyan Nov 14 '15 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.