ffmpeg command

Hi, hoping someone can help

I have been using ffmpeg to convert my mkvs into mp4/ac3 so that they always direct play using the following command:

FFmpeg.exe -i c:\Video\Avengers.mkv -vcodec copy -acodec ac3 -b:a 640k c:\Video\Avengers.mp4

and this works perfectly, however with some devices not supporting ac3, i want to redo but make it so that the mp4 file has a 2ch aac track first and then the ac3 track second, i dont want to lose any quality as these are full blu-ray rips, does anyone have any ideas.

Check the thread in my sig for scripts to do this.

Just having a look now, what do i do if i want to change the aac track to 128kbps, that is what i have been using whenever i handbrake anything, i find that it is the most consistent across ios and android at direct playing.

Just tried my adding Man on fire(mof.mkv) into the process folder, and running the run.bat file, and this is what comes back.

C:\Convert>run.bat

C:\Convert>c:\python27\python manual.py -a -i c:\convert\process
Traceback (most recent call last):
File “manual.py”, line 11, in
from readSettings import ReadSettings
File “C:\Convert\readSettings.py”, line 9, in
from babelfish import Language
File “C:\Convert\babelfish_init_.py”, line 20, in
from .converters import (LanguageConverter, LanguageReverseConverter, Langua
geEquivalenceConverter, CountryConverter,
File “C:\Convert\babelfish\converters_init_.py”, line 6, in
from pkg_resources import iter_entry_points, EntryPoint
ImportError: No module named pkg_resources

C:\Convert>

What am i missing?

@cayars said:
Check the thread in my sig for scripts to do this.

Just tried my adding Man on fire(mof.mkv) into the process folder, and running the run.bat file, and this is what comes back.

C:\Convert>run.bat

C:\Convert>c:\python27\python manual.py -a -i c:\convert\process
Traceback (most recent call last):
File “manual.py”, line 11, in
from readSettings import ReadSettings
File “C:\Convert\readSettings.py”, line 9, in
from babelfish import Language
File “C:\Convert\babelfish_init_.py”, line 20, in
from .converters import (LanguageConverter, LanguageReverseConverter, Langua
geEquivalenceConverter, CountryConverter,
File “C:\Convert\babelfish\converters_init_.py”, line 6, in
from pkg_resources import iter_entry_points, EntryPoint
ImportError: No module named pkg_resources

C:\Convert>

What am i missing?

Also, what do i do if i want to change the aac track to 128kbps, that is what i have been using whenever i handbrake anything, i find that it is the most consistent across ios and android at direct playing.

I’d install python27 again. Are you running 64 or 32 bit python. Have it match your operating system.

I’d then unzip the convert scripts and try them before making any modifications. Let’s get it working then we can play.

Carlo

Installed the latest 27 version, and give, what next?

If I have a video where the first stream is the video and the second is the surround sound (maybe ac3), I use something like below. It will copy the video, convert the audio to aac 2 channel 192k and add it as the 1st audio track, then copy the original audio and add it as the 2nd audio track. This works well for me, but I have to be sure the streams map correctly. Also, there may be other data I need to map, such as chapters or something. That’s as easy as adding something like -map 0:2 though. FFmpeg will tell you what’s what.

Note: I use Cygwin with zsh (which gives a Linux-like terminal on Windows), so you might need to slightly edit this command.

ffmpeg -i "Avengers.mp4" \
    -map 0:0 -map 0:1 -map 0:1 \
    -c:v copy \
    -c:a:0 aac -b:a:0 192k -ac 2 \
    -c:a:1 copy \
    "E:/Media/Conversions/Avengers.mkv"

@cayars said:
I’d install python27 again. Are you running 64 or 32 bit python. Have it match your operating system.

I’d then unzip the convert scripts and try them before making any modifications. Let’s get it working then we can play.

Carlo

Hi, I have installed the latest python27 (64bit to match os) and unzipped the files again, placed a video file in the process folder and ran run.bat, but still get the same result, I must be missing a step, or is there some setup of python that I need to do, apologies I have never used python before.

What country are you in?
Did you make any changes at all to the ini file?

@cayars said:
What country are you in?
Did you make any changes at all to the ini file?

No not touched anything with your convert folder apart from adding a video file into the process folder

and your country?

@cayars said:
and your country?

UK

What’s the native language you mainly use and what language is your computer set to use?

@cayars said:
What’s the native language you mainly use and what language is your computer set to use?

Englsh and pc is set to english uk, running windows 10

Just got it working, uninstalled python, and download again, but this time used 32bit. cheers for your assistance and the script.

NICE!

Kind of weird about the 64 bit python not working. I have both 32 and 64 bit working on Windows 10 64bit computers.

The good news is that this doesn’t matter in the least and there is no speed difference as far as the scripts are concerned. Almost all the time is spent in ffmpeg doing the conversions