News:

--

Main Menu

Batch Processing (Command Line) issue.

Started by sark, March 20, 2019, 10:50:57 AM

Previous topic - Next topic

sark

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

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

Jan Gruuthuse


dosdan

#2
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

sark

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