VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hi.
    I want to bach merge videos with audio.
    For one episode there are two qualities (HD and FHD) and one audio file.
    All files have .mp4 extension.
    The name pattern looks like this:

    001f_1920x1080 HD.mp4, 001_1280x720 HD.mp4, 001a_Spanish (es).mp4
    002f_1920x1080 HD.mp4, 002_1280x720 HD.mp4, 002a_Spanish (es).mp4
    003f_1920x1080 HD.mp4, 003_1280x720 HD.mp4, 003a_Spanish (es).mp4
    Is there a way to batch mux audio and video? I want to make sure that correct audio will be merged with video.
    Last edited by m0ck; 5th Jul 2019 at 06:10.
    Quote Quote  
  2. Try:

    Code:
    SETLOCAL ENABLEDELAYEDEXPANSION
    
    for %%a in ("*(es).mp4") do (
    	set number=%%a
    	ffmpeg -i "!number:~0,3!f_1920x1080 HD.mp4" -i "%%~a" -map 0:v -map 1:a -c copy "!number:~0,3!f_1920x1080 HD ES.mp4"
    	ffmpeg -i "!number:~0,3!_1280x720 HD.mp4" -i "%%~a" -map 0:v -map 1:a -c copy "!number:~0,3!_1280x720 HD ES.mp4"
    )
    Quote Quote  
  3. Thanks, it seems to be working.
    Is there an option to automatically delete video and audio files once merged successfully?
    Quote Quote  
  4. Should be possible by checking ffmpeg return code (IF NOT ERRORLEVEL 1 ...). Not sure how reliable that would be.
    Quote Quote  
  5. Can you provide a script if that's not a problem. I a noob with this stuff unfortunately.
    Quote Quote  



Similar Threads