I have a bunch of video files in a folder that I need to mass mux to mp4.
Each video has a aac audio file and a h264 video file.
mp4box does a good job, but it will only allow me to select one file at a time and there's a 10 second pause after it selects the audio track, before I can add it to the queue. This would take ages just to get the queue ready.
I am looking for a batch muxer or something that will enable me to queue up the audio and video file quickly.
Thanks in advance.
P.S. I am not interested in re-encoding the videos.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 11 of 11
Thread
-
-
Use mp4box from the command line. As long as all videos have the same framerate it's easy. In this example the framerate for all the videos is 25.00. If your videos are 23.976 or 29.97 just change that part of the bat script. So copy and paste the text below into notepad, change the path to mp4box.exe, output folder name, and fps if necessarry, then save that as "mp4mux.bat". Put mp4mux.bat into the folder containing all your video and audio files and double click it. It will batch mux all your video and audio files without any user interaction necessary.
Code:for %%a in (*.h264) do "C:\Path\to\Your\Copy\Of\MP4Box.exe" -add "%%a:fps=25.00" -add "%%~na.aac" "C:\Your\Output\Folder\%%~na.mp4"
Donadagohvi (Cherokee for "Until we meet again") -
Thanks a lot man, works well on a couple of testers I did. Only curious thing was that it would import the h264 file fine, but did not like the name of the aac file and would fail when importing it. The video files were named video name_track1.h264 and audio was video name_track2.aac. I guessed the script was saying "import the h264 file and then add any aac file with exact same name. Anyway I changed the audio to have same name as video and it muxed fine.
A couple more questions. Is there any programe that will allow me to see the framerate of all files in a folder, so I can easily create seperate batch files andn folders for differing fps? Also, is it possible to add an srt to that script you gave? Thanks a bunch, really appreciate you fixing the above issue for me. I hate scripts, but that one was easy.Last edited by dukestravels07; 11th Jul 2010 at 03:12.
-
Yep sorry I should have been more explanatory that all files (video, audio, subs) should be named the same (with the exception of their extensions of course).
A couple more questions. Is there any programe that will allow me to see the framerate of all files in a folder, so I can easily create seperate batch files andn folders for differing fps?
Also, is it possible to add an srt to that script you gave? Thanks a bunch, really appreciate you fixing the above issue for me. I hate scripts, but that one was easy.
So your new bat script would be like this
Code:for %%a in (*.h264) do "C:\Path\to\Your\Copy\Of\MP4Box.exe" -add "%%a:fps=25.00" -add "%%~na.aac" -add "%%~na.srt" "C:\Your\Output\Folder\%%~na.mp4"
Donadagohvi (Cherokee for "Until we meet again") -
Thanks for additional info.
One last thing. Do you have a code for a batch file that I can throw into a folder with mkv files in it?. Something that will extract the aac and h264 files for me. Something that would use mkvextract or the like? I like the idea of running a batch file and leaving it to do its job. Thanks again! -
Assuming that there is only one video and audio in each mkv file.
Code:@for %%a in (*.mkv) do "C:\Path\to\mkvextract.exe" tracks "%%a" 1:"%%~na.h264" 2:"%%~na.aac"
Code:@for %%a in (*.mkv) do "C:\Path\to\mkvextract.exe" tracks "%%a" 1:"%%~na.h264" 2:"%%~na.aac" 3:"%%~na.srt"
You could even combine the extract and mux files into one batch file
Do it like this with no subs
Code:@for %%a in (*.mkv) do "C:\Path\to\mkvextract.exe" tracks "%%a" 1:"%%~na.h264" 2:"%%~na.aac" @for %%a in (*.h264) do "C:\Path\to\Your\Copy\Of\MP4Box.exe" -add "%%a:fps=25.00" -add "%%~na.aac" "C:\Your\Output\Folder\%%~na.mp4"
Code:@for %%a in (*.mkv) do "C:\Path\to\mkvextract.exe" tracks "%%a" 1:"%%~na.h264" 2:"%%~na.aac" @for %%a in (*.h264) do "C:\Path\to\Your\Copy\Of\MP4Box.exe" -add "%%a:fps=25.00" -add "%%~na.aac" -add "%%~na.srt" "C:\Your\Output\Folder\%%~na.mp4"
Donadagohvi (Cherokee for "Until we meet again") -
Jagabo's ffmpeg command line works well.
for %%a in (*.mkv) do "c:\path\to\ffmpeg.exe" -i "%%a" -acodec copy -vcodec copy "%%~na.mp4"
However, when I examine the resulting mp4 files with mediainfo, the chapter markers are written twice,
once for the video stream, and again for the audio stream. Doing some Google searches, I found the
following command line switch:
"-movflags disable_chpl"
This switch seems to do the trick of only writing the chapter info once, although the resulting mp4 when examined with
mediainfo show the chapters as a separate stream.
Does ffmpeg have another, better command line switch to copy over chapter info from an mkv to an mp4?
Thanks.Last edited by pm1315; 29th Mar 2015 at 03:08. Reason: correction
-
Yes, you are correct Jagabo. Thanks.
Original MKV
Menu
00:00:00.000 : en:Chapter 1
00:05:00.000 : en:Chapter 2
00:10:00.000 : en:Chapter 3
00:15:00.000 : en:Chapter 4
00:20:00.000 : en:Chapter 5
00:25:00.000 : en:Chapter 6
00:30:00.000 : en:Chapter 7
00:35:00.000 : en:Chapter 8
00:40:00.000 : en:Chapter 9
00:45:00.000 : en:Chapter 10
Remuxed to MP4 with ffmpeg using the "-movflags disable_chpl" switch
Menu
ID : 3
Codec ID : text
Duration : 1h 38mn
Language : English
Duration_LastFrame : -82624
00:00:00.000 : Chapter 1
00:05:00.000 : Chapter 2
00:10:00.000 : Chapter 3
00:15:00.000 : Chapter 4
00:20:00.000 : Chapter 5
00:25:00.000 : Chapter 6
00:30:00.000 : Chapter 7
00:35:00.000 : Chapter 8
00:40:00.000 : Chapter 9
00:45:00.000 : Chapter 10
Bit rate mode : VBR
Similar Threads
-
How to Convert h264.MP4 to avi?
By skorpinok in forum Video ConversionReplies: 20Last Post: 22nd Oct 2015, 08:31 -
muxing raw h264 with raw g711 to mp4 continer
By niror in forum Newbie / General discussionsReplies: 5Last Post: 23rd Aug 2011, 12:25 -
Need to convert raw .h264 stream to edit in Vegas Pro 9
By cintec in forum EditingReplies: 18Last Post: 9th Aug 2009, 13:44 -
How to create .mp4 file by using raw .h264 and .aac files for JW Player
By hakkinen in forum Newbie / General discussionsReplies: 2Last Post: 10th Mar 2009, 21:49 -
What do I do with a raw .h264 file extracted from an .mp4 container?
By godfist314 in forum Newbie / General discussionsReplies: 4Last Post: 22nd Jul 2008, 13:51