Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: sark on March 20, 2019, 10:50:57 AM

Title: Batch Processing (Command Line) issue.
Post by: sark on March 20, 2019, 10:50:57 AM
Hi all.

I've adapted the first command line .bat file example from (link below) to convert from mp4 to mkv container.

https://www.avidemux.org/admWiki/doku.php?id=tutorial:batch_processing (https://www.avidemux.org/admWiki/doku.php?id=tutorial:batch_processing)

The only minor issue I'm having is files named something.mp4 becomes something.mp4.mkv. I've tried everything, but can't remove the
additional .mp4 from the names. I know this is how it was intended to work, but if possible I'd rather it wasn't there.

Any advice would be greatly appreciated.

sark
Title: Re: Batch Processing (Command Line) issue.
Post by: Jan Gruuthuse on March 20, 2019, 03:56:27 PM
Perhaps this is of some help: Convert_AVI_to_MP4.bat (https://avidemux.org/smif/index.php/topic,17182.msg77307.html#msg77307)  (check for typo)
Title: Re: Batch Processing (Command Line) issue.
Post by: dosdan on March 20, 2019, 09:27:05 PM
While I normally use a FOR... IN () DO loop to phrase/extract parts of filenames, it's not strictly necessary. (Looping is good when handling multiple files.) The same parsing techniques can be used for just a single file.

For example: pharsing_test.bat 

@echo off
echo %1
echo %~n1
echo %~n1.mk4


Using any filename (it doesn't have to exist)  here's how to specify a different file extension:

D:\>pharsing_test.bat test.mp4
test.mp4
test
test.mk4


Here the list of parameter extensions:  https://ss64.com/nt/syntax-args.html
Title: Re: Batch Processing (Command Line) issue.
Post by: sark on March 21, 2019, 02:00:43 PM
Thanks for the responses. Will play around tonight. I'm not really sure why that .bat example included the original extension  after converting.
Figured it shouldn't be too hard too end up with something .mkv, just couldn't figure it out. Confident I can solve now.

Thanks again.

sark