Hello.
I'm currently using ffmpeg to convert my mkv files with e-ac3 audio to ac3, with this command line:
It works great, but it takes a long time when you have more than 1 file. So do you if there is a way to batch convert several files, instead of opening a different command line each time?Code:ffmpeg -hwaccel auto -y -i "input.mkv" -map 0 -c:s copy -c:v copy -c:a ac3 -b:a 640k "output.mkv"
Thank you.
+ Reply to Thread
Results 1 to 30 of 31
-
-
Sorry, can you explain in more details? I don't get what to do (I'm still a beginner). Thanks.
-
-
I'm sorry, I know nothing about coding, I was simply given the instructions to do that one conversion, and it worked. But where do I enter the files names in that code? I have 12 in the same folder.
Sorry if I'm a pain. -
You don't enter file names at all. The "for" command will automatically pick up and enter the file names for you in a loop.
-
Ok, that's what I thought, but I entered your command line, but it's not working, it says %%a was unexpected.
-
You can use this tool in the future for batch converting and saving your ffmpeg long presets:
FFmpeg Batch -
I also used the freeware Xmedia Recode to convert the audio tracks of MKVs. I set it to copy (not convert) the video and converted the audio to AC3.
-
Just wanted to share this. I am running Ubuntu Linux and none of the above solutions worked for me. I combined stuff and now works like a charm. It just takes a few seconds to convert large files. Hope This Helps for others
Code:#!/bin/bash for f in *.mkv; do ffmpeg -y -i "$f" -map 0 -c:v copy -c:a ac3 -b:a 640k -c:s copy "${f%.*}-ac3.mkv"; done
-
-
Try ..
Code:for %%a in (*.mkv) do ffmpeg -i "%%a" -c:a ac3 -b:a 640k "output_%%~na.ac3" pause
責任者-MDX -
I have another request (maybe I should open a new thread). Can I use the same command line to convert the audio to ac3 and convert it from 25 fps to 23.976 fps at the same time?
If not, is there at least a script to convert the audio to a different frame rate?
Thanks. -
try
Code:for %%a in (*.ac3) do ffmpeg -y -i "%%a" -map 0:0 -af "atempo=0.959040" -vn -c:a ac3 -b:a 640k -ar 48000 "%%~na.new.ac3"
責任者-MDX -
Actually it didn't work properly, I need to convert the audio to eliminate the PAL speed-up, it is originally NTSC, but your command line seems to have slowed down the files to 23.976 fps but kept the same pitch as it was at 25 fps, it sounds the same! What is the way to just restore the NTSC tempo and pitch?
-
Try something like:
Code:-af asetrate=48000*(24000/(1001*25)),aresample=48000
Last edited by sneaker; 12th Apr 2020 at 06:33. Reason: 48000 Hz not kHz
-
That one does the job, thank you!
I might as well use this to batch convert the videos to 23.976 fps as well, do you know what the full command line for that would be?Last edited by Nico Darko; 12th Apr 2020 at 16:12.
-
-
Code:
for %%a in (*.mkv) do ffmpeg -y -i "%%a" -map 0:v -map 0:a:1 -map 0:s? -c:v copy -c:a ac3 -b:a 640k -c:s copy "output_%%~na.mkv"
https://trac.ffmpeg.org/wiki/Map -
What would it be to go from 23.976 to 25fps? and with aac audio?
Edit: I've just tried:
for %%a in (*.aac) do ffmpeg -y -i "%%a" -map 0:0 -af asetrate=48000*(25000/(1001*24)),aresample=48000 "%%~na.new.aac"
It seems to have worked, but it reduced the bitrate from 192kbs to 130kbsLast edited by Nico Darko; 7th May 2020 at 12:02.
-
Code:
-af asetrate=48000*((25*1001)/24000)),aresample=48000
But maybe for PAL-Speedup keeping pitch using -atempo as suggested by sekininsha is a better solution? -
-
Code:
for %%a in (*.mkv) do ffmpeg -y -i "%%a" -map 0:v -map 0:a -map 0:a -map 0:s? -c:v copy -c:a:0 copy -c:a:1 ac3 -b:a:1 640k -c:s copy "output_%%~na.mkv
https://trac.ffmpeg.org/wiki/Map
Similar Threads
-
TrueHD/AC3 question (384 core) need 640 ac3
By PatrickBatman in forum Blu-ray RippingReplies: 16Last Post: 31st Dec 2015, 16:10 -
ffmpeg - MPEG TS - wrong ES stream_type in PMT for AC3
By palettenheinze in forum Video ConversionReplies: 5Last Post: 30th Nov 2014, 08:41 -
True HD AC3, E-AC3 will not play or encode
By killerteengohan in forum AudioReplies: 6Last Post: 9th Jul 2014, 17:36 -
5.1 wav or 6 mono wavs to 5.1 Ac3 conversion
By wturner in forum AudioReplies: 38Last Post: 24th Nov 2013, 08:26