VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Member
    Join Date
    Jan 2016
    Location
    London
    Search PM
    Hey guys,
    I'm trying to join a couple of mkv files. Let's say for instance these are called V1, V2, V3 and V4.
    I know that they need to be identical in terms of video resolution and codec, so I am to be able to append one to another.
    I have checked each video and compared the details using MediaInfo with every other video and they seem identical (apart from overall bitrate, which is to be expected).
    However, when trying to append them using MKVToolNix or AVIdemux it doesn't work.
    Then I noticed there was a small difference when opening them in MKVExtractGUI:
    V1: [video][V_MPEG4/ISO/AVC][H.264 1904x1072 L4.1][eng][1904x1072][length 44 (h.264 profile: High @L4.1)][0 ms][0 ms] Duration: 00:00:30
    V2: [video][V_MPEG4/ISO/AVC][H.264 1904x1072 L4.1][eng][1904x1072][length 41 (h.264 profile: High @L4.1)][0 ms][0 ms] Duration: 00:01:30
    V3: [video][V_MPEG4/ISO/AVC][H.264 1904x1072 L4.1][eng][1904x1072][length 44 (h.264 profile: High @L4.1)][0 ms][0 ms] Duration: 00:30:00
    V4: [video][V_MPEG4/ISO/AVC][H.264 1904x1072 L4.1][eng][1904x1072][length 45 (h.264 profile: High @L4.1)][0 ms][0 ms] Duration: 00:01:30

    My question is how can I change V2 and V4 to match the rest of the video files. BTW i joined V1 and V3 and they worked, so the issue is definitely this 'length'. Unfortunately i have no idea what it is .

    All suggestions are appreciated.
    Thanks
    Last edited by thufz; 29th Jan 2016 at 19:28.
    Quote Quote  
  2. H.264 can have more underlying differences than what can be seen in MediaInfo. The most "proper" solution is to re-encode all (minus 1) parts so they match exactly.

    What works in many (but not all players) is to append them anyways while making sure the H.264 headers are repeated throughout the stream. You can try to use ffmpeg's "concat demuxer" for that: https://trac.ffmpeg.org/wiki/Concatenate

    Originally Posted by thufz View Post
    However, when trying to append them using MKVToolNix or AVIdemux it doesn't work.
    "doesn't work" as in "video becomes b0orked in my player" or as in "I see an mkvmerge warning message"? Because the warning message alone does not necessarily mean there's a problem. Test in your player.
    Quote Quote  
  3. Member
    Join Date
    Jan 2016
    Location
    London
    Search PM
    Originally Posted by sneaker View Post
    H.264 can have more underlying differences than what can be seen in MediaInfo. The most "proper" solution is to re-encode all (minus 1) parts so they match exactly.

    What works in many (but not all players) is to append them anyways while making sure the H.264 headers are repeated throughout the stream. You can try to use ffmpeg's "concat demuxer" for that: https://trac.ffmpeg.org/wiki/Concatenate

    Originally Posted by thufz View Post
    However, when trying to append them using MKVToolNix or AVIdemux it doesn't work.
    "doesn't work" as in "video becomes b0orked in my player" or as in "I see an mkvmerge warning message"? Because the warning message alone does not necessarily mean there's a problem. Test in your player.
    It doesn't work, as in, the first video will play fine (V1), but the rest of the combined video just displays a green screen, with audio.

    What method would you suggest to make them all match so that i can join them.
    Quote Quote  
  4. If you don't know how you have to re-encode all parts using exactly the same settings in x264 with the added parameter "--stitchable" in the encoding software of your choice. Then you should be able no append them using mkvmerge without the screen becoming green.

    Or you try the ffmpeg method I mentioned above.
    Quote Quote  
  5. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    if you really want to join them put them all onto the timeline of a video editor and render them out to a single new video. or find the original source and make your own.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  6. Member
    Join Date
    Jan 2016
    Location
    London
    Search PM
    Originally Posted by sneaker View Post
    If you don't know how you have to re-encode all parts using exactly the same settings in x264 with the added parameter "--stitchable" in the encoding software of your choice. Then you should be able no append them using mkvmerge without the screen becoming green.

    Or you try the ffmpeg method I mentioned above.
    I read through the ffmpeg method and honestly I don't understand it.
    Isn't there a simpler way of doing this. All I want to do is combine the four videos into one output file. that will play as normal with no faults (e.g. green screen)

    As you suggested above I could re-encode the shorter video files to match the bigger one and then append using mkvmerge. Could you tell me how to do this (in simple terms) .
    I really don't want to re-encode every part and go through hours of re-encoding.
    Would really appreciate it. Thanks
    Quote Quote  
  7. Originally Posted by thufz View Post
    I read through the ffmpeg method and honestly I don't understand it.
    You only need to follow the small part at the beginning of the doc:
    Click image for larger version

Name:	ffmpeg_concat_demuxer_.png
Views:	7952
Size:	14.2 KB
ID:	35474

    Originally Posted by thufz View Post
    As you suggested above I could re-encode the shorter video files to match the bigger one and then append using mkvmerge. Could you tell me how to do this (in simple terms) .
    I cannot explain in simple terms. Re-encoding everything or using the ffmpeg method is much simpler.
    Quote Quote  
  8. Member
    Join Date
    Jan 2016
    Location
    London
    Search PM
    Originally Posted by sneaker View Post
    Originally Posted by thufz View Post
    I read through the ffmpeg method and honestly I don't understand it.
    You only need to follow the small part at the beginning of the doc:
    Image
    [Attachment 35474 - Click to enlarge]


    Originally Posted by thufz View Post
    As you suggested above I could re-encode the shorter video files to match the bigger one and then append using mkvmerge. Could you tell me how to do this (in simple terms) .
    I cannot explain in simple terms. Re-encoding everything or using the ffmpeg method is much simpler.
    Thank you. FFmpeg Concat demux worked perfectly.

    To anyone who comes onto this thread and requires a more detailed explanation, just follow these steps:
    • Download FFmpeg for the operating system you are using (e.g. Windows)
    • Extract it
    • Create a mylist.txt
      Note: you can call it anything, just make sure to correctly put down the name of the file in the ff-prompt
    • Open the .txt file and enter the following:
      file '/path/to/file1' (e.g. 'C:\Videos\V1.mkv')
      file '/path/to/file2' (e.g. 'C:\Videos\V2.mkv')
      file '/path/to/file3' (e.g. 'C:\Videos\V3.mkv')
      file '/path/to/file4' (e.g. 'C:\Videos\V4.mkv')
      etc.
    • Save the .txt file
    • Open ff-prompt
    • Enter:
      ffmpeg -f concat -i mylist.txt -c copy output
      (e.g. ffmpeg -f concat -i C:\Videos\ffmpeg 2.8.6\mylist.txt -c copy C:\Videos\output.mkv)
      Note: Make sure to put down the correct path to your .txt file and put down the file extension for the output video file. Also, the output file can be called anything, does not have to be output.
    • Hit ENTER. That's it, let the program run and you should have a single concatenated video file.

    Hope this helps. Thanks again sneaker
    Last edited by thufz; 2nd Feb 2016 at 02:57.
    Quote Quote  
  9. Member
    Join Date
    Jan 2016
    Location
    London
    Search PM
    Another question.
    sneaker if you could help me out again would really appreciate it.

    Is there a way of cutting or splitting a video without re-encoding?

    Thanks
    Quote Quote  
  10. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    You can use mkvtoolnixgui to cut without reconverting, under the output tab enable splitting and type in time. See: https://forum.videohelp.com/threads/359121-How-to-extract-cut-parts-from-a-mkv-includin...ubtitle-tracks
    Quote Quote  
  11. Member
    Join Date
    May 2016
    Location
    Indonesia
    Search Comp PM
    Originally Posted by thufz View Post
    Originally Posted by sneaker View Post
    Originally Posted by thufz View Post
    I read through the ffmpeg method and honestly I don't understand it.
    You only need to follow the small part at the beginning of the doc:
    Image
    [Attachment 35474 - Click to enlarge]


    Originally Posted by thufz View Post
    As you suggested above I could re-encode the shorter video files to match the bigger one and then append using mkvmerge. Could you tell me how to do this (in simple terms) .
    I cannot explain in simple terms. Re-encoding everything or using the ffmpeg method is much simpler.
    Thank you. FFmpeg Concat demux worked perfectly.

    To anyone who comes onto this thread and requires a more detailed explanation, just follow these steps:
    • Download FFmpeg for the operating system you are using (e.g. Windows)
    • Extract it
    • Create a mylist.txt
      Note: you can call it anything, just make sure to correctly put down the name of the file in the ff-prompt
    • Open the .txt file and enter the following:
      file '/path/to/file1' (e.g. 'C:\Videos\V1.mkv')
      file '/path/to/file2' (e.g. 'C:\Videos\V2.mkv')
      file '/path/to/file3' (e.g. 'C:\Videos\V3.mkv')
      file '/path/to/file4' (e.g. 'C:\Videos\V4.mkv')
      etc.
    • Save the .txt file
    • Open ff-prompt
    • Enter:
      ffmpeg -f concat -i mylist.txt -c copy output
      (e.g. ffmpeg -f concat -i C:\Videos\ffmpeg 2.8.6\mylist.txt -c copy C:\Videos\output.mkv)
      Note: Make sure to put down the correct path to your .txt file and put down the file extension for the output video file. Also, the output file can be called anything, does not have to be output.
    • Hit ENTER. That's it, let the program run and you should have a single concatenated video file.

    Hope this helps. Thanks again sneaker
    Hello.
    I have the same problem as you, so I followed your direction.
    But, I got this "unsafe file name" issue instead.
    Honestly, I have no idea as to why it is "unsafe", and the article in https://www.ffmpeg.org/ffmpeg-formats.html#Options is just too technical for me to follow, seeing that this is the first time I've even touched FFmpeg.
    Can you or someone here help me, please?
    Quote Quote  



Similar Threads

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