VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Hey there I have a unique problem. I downloaded a bunch of old tv episodes from youtube of a show I used to watch and each episode came in 3 videos. I appended each video together and have ran into a weird problem. I noticed that instead of having only 1 audio and 1 video track on each video there are actual 3 audio tracks and 1 video track... So it seems it only made the video tracks into one file but not the audio tracks.... (This causes the 2nd and 3rd parts of the video to have no sound)

    Is there a way I can easily convert all of the episodes into new files where it fixes this issue?

    What I would need it to do is append all the audio tracks in the file (they are in order; track 2, track 3, track 4) then remux the single audio track with the single video track... Maybe an avs script of somekind can do this ???

    Thanks!
    Quote Quote  
  2. I hardly ever work with MP4s but if the audio in each is of the same type you should be able to append them. Which software did you use?
    If you're not needing them to be MP4, try opening the first one with MKVMergeGUI and use the Append button for the rest, then remux them as a single MKV. I just gave it a quick test using a couple of MP4s which I know have the same type of audio and video and it worked fine. If MKVMergeGUI has any problems it should display them in the "Warnings" or "Errors" section while remuxing.

    MKVMergeGUI is one of the main reasons I stick with MKV as much as possible as there's no similar tool for MP4s I know of which makes working with MP4s anywhere nearly as easy. That and the fact the MP4 container is way more limited in the types of audio/video it can contain.

    If the audio is different you may need to convert them to a common type. AnyVideoConverter will append files while converting and I'm fairly sure it has an option to copy the video while converting the audio (and the other way around). FFCoder should do the same.
    Quote Quote  
  3. Yeah I need it to be in MP4 x264 video, stereo low complexity aac audio format... Also I don't think you got what I meant. I have multiple episodes. Each episode has 1 video. Contained in the container of this video there is one .h264 video stream and 3 audio streams. the video track is labeled track 1 and the audio tracks are labeled track 2, track 3, and track 4. I need to append track 2, track 3, and track 4 together and then mux the appended complete track with the video track. These tracks are all contained within a single file. I could jsut extract the audio streams, append them using a tool (not sure what to use), then remux them with the video stream BUT there are a total of 65 episodes soooo yeah you see what I am getting at?
    Quote Quote  
  4. Assuming the expisodes have been encoded with compatible setting have you tried any MP4Box GUI to append/merge the files or MP4Box via command line?
    Quote Quote  
  5. Originally Posted by Selur View Post
    Assuming the expisodes have been encoded with compatible setting have you tried any MP4Box GUI to append/merge the files or MP4Box via command line?
    Yeah I have..... Actually I am fairly sure that is what I used or I did try it I know that and it did not work for this... I literally have 65 episodes, each episode is 1 MP4 file and contained in the MP4 files is 1 video track and 3 audio tracks...... I guess if it isn't possible to batch extract, append track 2 with track 3 and with track 4 and then remux with the video stream then is there a good program I can use to just append the audio together (after I extract it of course)??????

    I would prefer some sort of batch that did this for each file for me because it is probably going to take a verrrrrrrrry long time..... Anyways respond ASAP that way I can get cracking on this I guess lol...
    Quote Quote  
  6. I'm still a bit confused if you have 65 files with this layout:
    mp4(v1,a1,a2,a3) which plays synchronous
    and you would join the audio streams of each file you would get 65 files with:
    mp4(v1,a1+a2+a3)
    problem there is, that the audio length would have grown, but the video length would still be the same.
    If you now append these 65 files the video and audio would be totally asynchronous.
    -> is that really what you want?
    If it is the easiest way to do this would be to write a batch which:
    1st uses ffmpeg to create the 65 files with the mp4(v1,a1+a2+a3) layout
    2nd uses mp4box to append the creates files
    3rd delete all unwanted files

    Cu Selur
    Quote Quote  
  7. Originally Posted by Selur View Post
    I'm still a bit confused if you have 65 files with this layout:
    mp4(v1,a1,a2,a3) which plays synchronous
    and you would join the audio streams of each file you would get 65 files with:
    mp4(v1,a1+a2+a3)
    problem there is, that the audio length would have grown, but the video length would still be the same.
    If you now append these 65 files the video and audio would be totally asynchronous.
    -> is that really what you want?
    If it is the easiest way to do this would be to write a batch which:
    1st uses ffmpeg to create the 65 files with the mp4(v1,a1+a2+a3) layout
    2nd uses mp4box to append the creates files
    3rd delete all unwanted files

    Cu Selur
    Alright you have somewhat of a correct idea BUT I don't want to append all 65 episodes (that would be like an extremely long movie lol)... But yes I do understand if I merge the 3 tracks in a file and then remux with the video track it will increase he file size a little bit. Here is an example Media Info of what I have:
    Code:
    General
    Complete name                            : C:\Users\Public\Videos\T.V. Shows\Episode1.mp4
    File size                                : 97.1 MiB
    Duration                                 : 24mn 5s
    
    Video
    Duration                                 : 24mn 5s
    Stream size                              : 79.5 MiB (82%)
    
    Audio #1
    Duration                                 : 8mn 11s
    Stream size                              : 5.63 MiB (6%)
    
    Audio #2
    Duration                                 : 7mn 26s
    Stream size                              : 5.10 MiB (5%)
    
    Audio #3
    Duration                                 : 8mn 27s
    Stream size                              : 5.81 MiB (6%)
    AND here is what I would like to achieve:
    Code:
    General
    Complete name                            : C:\Users\Public\Videos\T.V. Shows\Episode1.mp4
    File size                                : >97.1 MiB
    Duration                                 : 24mn 5s
    
    Video
    Duration                                 : 24mn 5s
    Stream size                              : 79.5 MiB (82%)
    
    Audio #1
    Duration                                 : 24mn 5s
    Stream size                              : >16.54 MiB (18%)
    I removed all the excess information that doesn't matter to make it easier to understand...
    So from your response I can conclude I should ignore step 2. As for step 1 "1st uses ffmpeg to create the 65 files with the mp4(v1,a1+a2+a3) layout" how the heck do I do this??? And if so how can I automate it so I don't have to manually do it for all 65 files???
    Quote Quote  
  8. 1. take a look at concatenation examples:
    https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files#filter
    (should be easy to adapt them to your need; either by using modifying the calls to work with one source, or loading the source two times)
    2. look at the ffmpeg batch examples:
    https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg
    and adjust one with the call from 1.
    3. use the batch created in 2. to do the work

    -> have fun!
    Quote Quote  
  9. Originally Posted by Selur View Post
    1. take a look at concatenation examples:
    https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files#filter
    (should be easy to adapt them to your need; either by using modifying the calls to work with one source, or loading the source two times)
    2. look at the ffmpeg batch examples:
    https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg
    and adjust one with the call from 1.
    3. use the batch created in 2. to do the work

    -> have fun!
    Oh so I can use FFMpeg to concatenate audio files??? Hmmm... So wait it can be used to extract the 4 streams, append the 3 audio streams, and remux the audio with the video???
    Quote Quote  
  10. Oh so I can use FFMpeg to concatenate audio files???
    yes
    Hmmm... So wait it can be used to extract the 4 streams, append the 3 audio streams, and remux the audio with the video???
    yes and the whole thing for one file can be done in one call.
    Quote Quote  
  11. Originally Posted by Selur View Post
    Oh so I can use FFMpeg to concatenate audio files???
    yes
    Hmmm... So wait it can be used to extract the 4 streams, append the 3 audio streams, and remux the audio with the video???
    yes and the whole thing for one file can be done in one call.
    Well I took a look at the pages and I gotta tell you I have no clue where to begin lol.... Probably shoulda stated I have never used FFmpeg before (or almost any command line tool) before... Any idea where to begin or even what the heck I would do...??? I would like to say I can write it myself but I would be lying... Just looking at the page makes my head hurt lol.

    EDIT: You know what i don't want to trouble you I am just going to manually do all of this... I found a good program that can append audio files for me easily and quickly and I can just use megui to do this. Thanks for the suggestion but I think it looks a bit too complicated for my understanding at the moment lol.
    Last edited by Whitezombie455; 17th Nov 2013 at 02:15.
    Quote Quote  
  12. Any idea where to begin???
    Read the example I pointed to at 1., the call used there:
    Code:
    ffmpeg -i input1.mp4 -i input2.webm -filter_complex '[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' <encoding options> output.mkv
    is explained, you just need to adjust it a bit.

    You need to:
    a. remove -i input2.webm
    b. replace <encoding options> with -acodec copy -vcodec copy
    c. replace output.mkv with output.mp4
    d. adjust the filter_complex-call to work with one source <- this is where the magic happens and where you need to think a bit (and read the explanation of the filter_complex )

    2. Once you got a call that works for one source, you look at the second link and take in example:
    Code:
    for %%a in ("*.mkv") do ffmpeg -i "%%a" -vcodec copy -acodec copy "newfiles\%%~na.mp4" pause
    Now you need to:
    a. replace .mkv with .mp4
    b. replace ffmpeg -i "%%a" -vcodec copy -acodec copy "newfiles\%%~na.mp4" with the call you came up with in 1.
    c. replace -i input1.mp4 with -i "%%a"
    d. create a folder newfiles next to you mp4 files
    e. change output.mp4 to "newfiles\%%~na.mp4"
    f. copy the whole text you now have into a .bat file next to your files
    g. drag&drop your files onto it

    At least that is how I would go at it.

    Cu Selur
    Quote Quote  



Similar Threads

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