VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Can someone please help me with this command? The audio won't convert to the desired codec nor bitrate. It just creates a copy of the original and changes the output to the desired (.mp4).

    set avidemux="C:\Program Files\Avidemux 2.7 VC++ 64bits\avidemux.exe"
    set videocodec=copy
    set audiocodec=AAC
    set audiobitrate=160
    for %%f in (*.mkv) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --audio-bitrate %audiobitrate% --load "%%f" --save "%%f.mp4" --quit
    Quote Quote  
  2. I don't know what the issue is with avidemux, but you could use ffmpeg instead:

    Code:
    set avidemux="ffmpeg.exe"
    set videocodec=copy
    set audiocodec=aac
    set audiobitrate=160k
    
    for %%f in (*.mkv) do %avidemux% -i "%%f" -c:v %videocodec% -c:a %audiocodec% -b:a %audiobitrate% "%%f.mp4"
    Use the full path to ffmpeg.exe if necessary. Codec "aac" must be lower case, not "AAC". Note the "k" for the audio bitrate -- k is not assumed.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    I don't know what the issue is with avidemux, but you could use ffmpeg instead:

    Code:
    set avidemux="ffmpeg.exe"
    set videocodec=copy
    set audiocodec=aac
    set audiobitrate=160k
    
    for %%f in (*.mkv) do %avidemux% -i "%%f" -c:v %videocodec% -c:a %audiocodec% -b:a %audiobitrate% "%%f.mp4"
    Use the full path to ffmpeg.exe if necessary. Codec "aac" must be lower case, not "AAC". Note the "k" for the audio bitrate -- k is not assumed.
    Thank you. The ffmpeg.exe method worked. I just wish avidemux worked because it's an amazing piece of software. Moreover, do you by any chance have the link for all the commands available for ffmpeg?
    Quote Quote  
  4. I noticed recently, while trying to help someone with a similar issue, that many options have been removed from Avidemux 2.7 as compared with earlier versions. No idea why.
    In particular --audio-bitrate is no longer available.
    https://forum.videohelp.com/threads/398292-Help-using-avidemux-command-line
    Learning how to use ffmpeg might be wiser, as it is improving over time, not regressing, but if you absolutely, positively got to use Avidemux CLI, try to get v. 2.6 instead.

    And I don't think that the arguments are case-sensitive, but "AAC" is apparently no longer accepted, it has to be a specific implementation like "FDK_AAC".
    Code:
    --audio-codec, set audio codec (copy|Lame|FDK_AAC|LavAC3|Opus|TwoLame|...)  (one arg )
    But what seems to be the official documentation seemingly hasn't been updated in years.
    http://avidemux.sourceforge.net/doc/en/command.xml.html

    Moreover, do you by any chance have the link for all the commands available for ffmpeg?
    The full integrated help (obtained by typing « ffmpeg -h full >"E:\ffmpeg help.txt" ») gets extracted as a whopping 800KB text file (to put this in perspective, that's bigger than Dante Alighieri's Divine Comedy and a tad smaller than Fiodor Dostoyevsky's Crime and punishment) and it only covers the basics of what's available / possible.


    @ jagabo
    set avidemux="ffmpeg.exe"
    Isn't it... unnecessarily convoluted and confusing ? O_o
    Last edited by abolibibelot; 10th Aug 2020 at 03:22.
    Quote Quote  
  5. It makes sense to use the correct tool for the job.

    For command-line use ffmpeg not avidemux.
    Quote Quote  
  6. It makes sense to use the correct tool for the job.
    But Avidemux CLI used to work well for simple tasks like that, do you have any idea why it's no longer the case ?
    Quote Quote  
  7. Originally Posted by chucknolan View Post
    Can someone please help me with this command? The audio won't convert to the desired codec nor bitrate. It just creates a copy of the original and changes the output to the desired (.mp4).

    set avidemux="C:\Program Files\Avidemux 2.7 VC++ 64bits\avidemux.exe"
    set videocodec=copy
    set audiocodec=AAC
    set audiobitrate=160
    for %%f in (*.mkv) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --audio-bitrate %audiobitrate% --load "%%f" --save "%%f.mp4" --quit
    Oops, wrong reply. Please delete it.
    Last edited by ProWo; 16th Mar 2021 at 07:34. Reason: wrong reply
    Quote Quote  
  8. Can someone tell me what I am doing wrong regarding ffmpeg.exe because I am trying to convert the mkv audio to HE-AAC while retaining the video copy. And, if possible, can you also provide a command for Change High Profile Level 5.1 to 4.1? Thank you.

    1) Trying to convert mkv audio using HE-AAC codec (see .bat command script below):

    set avidemux="ffmpeg.exe"
    set videocodec=copy
    set audiocodec=HE-AAC
    set audiobitrate=56k

    for %%f in (*.mkv) do %avidemux% -i "%%f" -c:v %videocodec% -c:a %audiocodec% -b:a %audiobitrate% "%%f.mp4"

    2) Changing High Profile Level 5.1 to 4.1 without re-encoding.
    Quote Quote  
  9. I get "Unkown encoder 'HE-AAC". I believe you need a build of ffmpeg that includes libfdk_aac. By the way, put "pause" at the end of your batch file so you can see the error message(s).
    Last edited by jagabo; 16th Mar 2021 at 05:48.
    Quote Quote  
  10. Originally Posted by jagabo View Post
    I get "Unkown encoder 'HE-AAC". I believe you need a build of ffmpeg that includes libfdk_aac. By the way, put "pause" at the end of your batch file so you can see the error message(s).
    Thanks. I tried adding the libfdk_aac in the batch as well, but it was ineffective. Nonetheless, I finally figured out the Avidemux encoding scripts using python scripts (.py). And in case you are interested, there's a video on youtube (https://www.youtube.com/watch?v=pxMeIU-ghXY) regarding its process, and I will attach two python scripts, in .txt, that I created (HE-AAC & LC-AAC) for you. Keep in mind that you will have to change the file extension of the .txt to .py, and thanks again.
    Quote Quote  
  11. Most builds of ffmpeg.exe don't include libfdk_aac because it's not "free". This site's build it has it build in:

    https://www.reddit.com/user/VeritablePornocopium/comments/ccilei/ffmpeg_with_libfdk_aa...r_windows_x64/

    And a batch file that uses it:

    Code:
    set avidemux=ffmpeg.exe
    set videocodec=copy
    set audiocodec=libfdk_aac -profile:a aac_he
    set audiobitrate=56k
    
    for %%f in (*.mkv) do %avidemux% -y -i "%%f" -c:v %videocodec% -c:a %audiocodec% -b:a %audiobitrate% "%%f.mp4"
    
    pause
    Quote Quote  
  12. Originally Posted by jagabo View Post
    Most builds of ffmpeg.exe don't include libfdk_aac because it's not "free". This site's build it has it build in:

    https://www.reddit.com/user/VeritablePornocopium/comments/ccilei/ffmpeg_with_libfdk_aa...r_windows_x64/

    And a batch file that uses it:

    Code:
    set avidemux=ffmpeg.exe
    set videocodec=copy
    set audiocodec=libfdk_aac -profile:a aac_he
    set audiobitrate=56k
    
    for %%f in (*.mkv) do %avidemux% -y -i "%%f" -c:v %videocodec% -c:a %audiocodec% -b:a %audiobitrate% "%%f.mp4"
    
    pause
    Thanks. I appreciate all the assistance. Moreover, I figured out how to reduce the Profile Level to my desired level, but in this case, 4.1.

    set avidemux="ffmpeg.exe"
    set videocodec=copy
    set audiocodec=copy

    for %%f in (*.mkv) do %avidemux% -i "%%f" -c:v %videocodec% -c:a %audiocodec% -bsf:v h264_metadata=level=41 "%%f.mp4"

    pause
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!