Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
18th October 2019, 06:33 | #1 | Link |
Registered User
Join Date: Jan 2005
Location: Sydney Australia
Posts: 260
|
Batch convert AVI to MKV
I'm sure this has been covered countless times but my searches for a simple straight forward method have been in vain. So is there either a script I can run or a GUI preferable. I have played with MKVToolNix but I always end up with one big file all titles being appended rather than as separate files.... In all I have around 100 avi files that I would like to put in a MKV container. Many thanks.
__________________
SONY 75" Full array 200Hz LED TV Yamaha A1070 amp Zidoo UHD3000, Popcorn Hour A-500 BeyonWiz PVR T3 & V2 (Enigma2 clone) Chromecast Pioneer Bluray BDP-150-K Windows 7 Ultimate QNAP NAS TS851 |
18th October 2019, 07:22 | #2 | Link |
Registered User
Join Date: Sep 2019
Posts: 37
|
While we're at it, I'll join your thread and ask for help too.
In the past, I've been using batch files to append videos (old 2 CD rips) and merge subs. They work fine most of the time but I notice several cases where the subs and/or the audio become a bit out of synch after the process. Any idea why ? Does it comes from the script or the input files ? The same thing has been happening using MKVToolNix. Also, I think it would be nice to have a thread with a collection of batches to perform various operations. |
18th October 2019, 08:08 | #3 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
You can try staxrip.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
18th October 2019, 10:06 | #4 | Link | |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Quote:
"MKVToolNix GUI"->"Preferences (Ctrl+P)"->"Multiplexer"->"When dropping files". There you can set to create new multiplex for each file or ask every time (when using drag&drop). Then you can add 100 files, click "Multiplexer"->"Actions for all tabs"->"Start multiplexing". Note that this will only change the container, not re-encode to more modern codecs. To do the latter you need a software like the mentioned StaxRip. You didn't say why you want to convert to mkv. |
|
18th October 2019, 11:01 | #5 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Code:
for %%i in (*.avi) do ( ffmpeg -fflags +genpts -i "%%i" -acodec copy -vcodec copy "%%~ni.mkv" )
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 18th October 2019 at 11:07. |
|
18th October 2019, 11:38 | #6 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Groucho2004 thing expanded a bit [no idea what "-fflags +genpts" does but I guess you could try add it (timestamps probably)]
Demo.Bat or Demo.Cmd Code:
REM We DO NOT LIKE SPACES IN FILE NAMES (REM == REMark ie comment) setlocal REM Where to Find ffmpeg set FFMPEG="C:\BIN\ffmpeg.exe" REM Where to get input file, No terminating Backslash, "." = current directory (ie same as .bat file dir) set INDIR="." REM Where to place output file, No terminating Backslash. "." would be same as .bat file : ".\OUT" = OUT folder in same directory as bat file. set OUTDIR="D:" REM Below, can add extensionas as eg *.WMV (SPACE separated) FOR %%A IN (*.Avi *.mp4) DO ( REM ****** Un-REM ONLY one of below lines *******. %FFMPEG% -i "%INDIR%\%%A" -vcodec copy -acodec copy "%OUTDIR%\%%~nxA.MKV" REM %FFMPEG% -i "%INDIR%\%%A" -vcodec utvideo -acodec copy "%OUTDIR%\%%~nxA.MKV" REM %FFMPEG% -i "%INDIR%\%%A" -vcodec utvideo -acodec pcm_s16le "%OUTDIR%\%%~nxA.AVI" REM *********************************************. ) REM ... Above UN-REM'ed lines : REM (1) Remux, copy both video and audio (output MKV). REM (2) UtVideo lossless video, copy audio (output MKV). REM (3) UtVideo lossless video, PCM audio (output AVI). Pause EDIT: I use 3rd one a lot for Avisynth, avoids lots of fussing about with FFMpegSource and LSmashSource, and [EDIT: Lossless] AVI is pretty much always frame accurate.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 18th October 2019 at 12:01. |
18th October 2019, 11:49 | #7 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
True, it's trial and error and/or some googleling (or is it googling? Who knows...).
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 18th October 2019 at 11:52. Reason: typo |
|
1st November 2019, 00:49 | #8 | Link | |
Registered User
Join Date: Jan 2005
Location: Sydney Australia
Posts: 260
|
Quote:
__________________
SONY 75" Full array 200Hz LED TV Yamaha A1070 amp Zidoo UHD3000, Popcorn Hour A-500 BeyonWiz PVR T3 & V2 (Enigma2 clone) Chromecast Pioneer Bluray BDP-150-K Windows 7 Ultimate QNAP NAS TS851 |
|
1st November 2019, 11:55 | #10 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Well -vcodec and -acodec are both used in the bat demo previoulsy posted, and have not ever caused me any problems.
Code:
REM ****** Un-REM ONLY one of below lines *******. %FFMPEG% -i "%INDIR%\%%A" -vcodec copy -acodec copy "%OUTDIR%\%%~nxA.MKV" REM %FFMPEG% -i "%INDIR%\%%A" -vcodec utvideo -acodec copy "%OUTDIR%\%%~nxA.MKV" REM %FFMPEG% -i "%INDIR%\%%A" -vcodec utvideo -acodec pcm_s16le "%OUTDIR%\%%~nxA.AVI"
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
Thread Tools | Search this Thread |
Display Modes | |
|
|