VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hi everybody

    I want to merge videos and audios with exact same name (1.mp4/1.acc and so on) in batch mode quickly using ffmpeg or any other tools that can do that?

    This screenshot might help: https://forum.videohelp.com/images/imgfiles/lZc0q2f.png

    Can you please help me do that? I don't know bash or powershell so I really appreciate it if you help me with a snippet.

    Thanks again.
    Quote Quote  
  2. Do the mp4 files contain audio or subs? If not:

    Code:
    md New
    for %%F in (*.mp4) do ( 
        ffmpeg -y -i "%%~nxF" -loglevel info -i "%%~nF.aac" -c copy -map 0:v -map 1:a  "New\%%~nxF" )
    )
    pause
    New files are created in a subfolder named New.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    Do the mp4 files contain audio or subs? If not:

    Code:
    md New
    for %%F in (*.mp4) do ( 
        ffmpeg -y -i "%%~nxF" -loglevel info -i "%%~nF.aac" -c copy -map 0:v -map 1:a  "New\%%~nxF" )
    )
    pause
    New files are created in a subfolder named New.
    Thank you so much your script works perfectly but I have another problem. If I merge a video and an audio using mkvtoolnix everything is fine, but using ffmpeg (whether your batch-script or a just a single command) still at the last stages of the process it throws lots of "Non-monotonous DTS in output stream 0:1; previous: 188443498, current: 188338176; changing to 188443499. This may result in incorrect timestamps in the output" and the output is not sync. https://forum.videohelp.com/images/imgfiles/pdQQcaC.png

    Why ffmpeg does not do what mkvtoolnix does when it comes to merging?
    Quote Quote  
  4. I don't know why ffmpeg gives those warnings. Is it giving you A/V sync problems? If you get so many errors that the processing is being slowed you can change the log level to ignore warnings. Add "-loglevel error -stats" to the ffmpeg line:

    Code:
    ffmpeg -y  -loglevel error -stats -i "%%~nxF" -loglevel info -i "%%~nF.aac" -c copy -map 0:v -map 1:a  "New\%%~nxF" )
    If you're getting A/V sync problems I'll need a sample pair to test with.
    Quote Quote  
  5. Originally Posted by jagabo View Post
    I don't know why ffmpeg gives those warnings. Is it giving you A/V sync problems? If you get so many errors that the processing is being slowed you can change the log level to ignore warnings. Add "-loglevel error -stats" to the ffmpeg line:

    Code:
    ffmpeg -y  -loglevel error -stats -i "%%~nxF" -loglevel info -i "%%~nF.aac" -c copy -map 0:v -map 1:a  "New\%%~nxF" )
    If you're getting A/V sync problems I'll need a sample pair to test with.
    Thanks again @jagabo

    Brought those files to another pc just to see the result and it worked well over there. So I think the problem was FFmpeg itself. Just tried to use another release of FFmpeg binary and fortunately everything is working like a charm now!
    Thank you again.
    [solved]
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!