View Full Version : batch demux .mpg to .m2v
JiiSune
2nd April 2011, 17:55
I've searched the forums and Google and tried numerous batch configurations. I'll be honest I'm a complete novice with this but I can copy and paste. :p
When I use dgindex by itself, dragging and dropping an .mpg file and then hitting save project and demux video it works perfectly producing a .m2v file.
But when I use any sort of .bat or .vbs script I just get a log file and a .d2v project file made.
I have 160 mpgs I need to batch demux to .m2v
Any suggestions?:thanks:
Blue_MiSfit
3rd April 2011, 07:12
write a windows batch script that uses the following ffmpeg command line:
ffmpeg -i video.mpg -vcodec copy video.m2v
J_Darnley
3rd April 2011, 10:25
If you want to demux the video using DGIndex, then use the right command line option. -od or -OFD.
JiiSune
3rd April 2011, 21:28
write a windows batch script that uses the following ffmpeg command line:
ffmpeg -i video.mpg -vcodec copy video.m2v
So just make a batch.bat file with that single line and it will go through the folder and batch them all?
Groucho2004
3rd April 2011, 22:12
So just make a batch.bat file with that single line and it will go through the folder and batch them all?
Try this in your batch file:
for %%i in (*.mpg) do ffmpeg -i %%i -vcodec copy %%i.m2v
(Note that the output files will have the format "xxxx.mpg.m2v").
JiiSune
3rd April 2011, 22:45
Try this in your batch file:
for %%i in (*.mpg) do ffmpeg -i %%i -vcodec copy %%i.m2v
(Note that the output files will have the format "xxxx.mpg.m2v").
Thank you for your reply but that doesn't seem to work. I tried double-clicking and dragging & dropping the files onto the .bat but it just pops up a cmd prompt real quick then closes.
Groucho2004
3rd April 2011, 22:49
You have to open a console window, change to the directory where the .mpg files AND the batch file are located and run it from there.
JiiSune
3rd April 2011, 22:58
This is the error I receive:
T:\MPGs>ffmpeg -i 1004 (EEE4-04).mpg -vcodec copy 1004 (EEE4-04).mpg.m2v
'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.
Groucho2004
3rd April 2011, 23:04
You have to give the full path to ffmpeg. For example:
"c:\tools\ffmpeg\ffmpeg.exe"
So, the batch file would be:
for %%i in (*.mpg) do "c:\tools\ffmpeg\ffmpeg.exe" -i %%i -vcodec copy %%i.m2v
JiiSune
3rd April 2011, 23:11
Hah this is great, looks like it is working for the video. Thanks so much. Is there any batch I can use for the audio? Or a way to make it a single file?
Groucho2004
3rd April 2011, 23:16
Is there any batch I can use for the audio?
Change "vcodec" to "acodec".
Or a way to make it a single file?
:confused:
JiiSune
3rd April 2011, 23:35
Change "vcodec" to "acodec".
:confused:
I meant a way to make it demux the video and audio at the same time. But this works just as well, I can't complain!
:thanks:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.