Log in

View Full Version : Is it safe to encode broken mkv parts and mux as whole?


zetsu_shoren
7th October 2014, 22:20
I want to encode a movie but I don't want my computer to be encoding nonstop for a long time. So I was wondering if it is completely safe (and smart) to split the movie into several files of 20 minutes each (+ the remaining minutes of the last file) and encode each one, and THEN attach them all together to make one whole file again.

I want to know what went wrong with what I did. There are sync issues, and if I am right, the gap gets bigger after every 20 minutes or so (the same amount as the duration I separated the files by (using mkvmerge GUI, by the way)). I noticed during a very slow falling snow scene (which was coincidentally on the verge of going to the next file with still the same snow falling scene), there was a frame skip. I had my suspicions cleared after very well seeing the snow skip ahead by a tiny bit.

If this is not a recommended method, is there any other way I can encode without having to do/encode the entire movie nonstop?

LoRd_MuldeR
8th October 2014, 00:06
I want to encode a movie but I don't want my computer to be encoding nonstop for a long time.

Can you explain why?

If it is because your computer is "overheating", you probably should get your cooling fixed (or stop overclocking, if you do) instead of trying such workarounds.

So I was wondering if it is completely safe (and smart) to split the movie into several files of 20 minutes each (+ the remaining minutes of the last file) and encode each one, and THEN attach them all together to make one whole file again.

There's at least the problem that if you use 2-Pass mode, the encoder will only be able to distribute the bits within each segment rather than having access to the whole movie.

This problem does not apply to CRF mode, though.

Also, if you use x264 for encoding, be sure to use the "--stitchable" option. It makes sure that different segments of a video will have identical headers, so they can be joined without problem.

See also:
http://git.videolan.org/?p=x264.git;a=commit;h=fa215fc9d77d131595e8b1eda0fc4e9da62c1f94

If this is not a recommended method, is there any other way I can encode without having to do/encode the entire movie nonstop?

If you don't need to switch off the computer entirely, you can just suspend the encoder process in Process Explorer (http://technet.microsoft.com/de-de/sysinternals/bb896653.aspx) and resume it at a later time.

And if you do need to switch power off, you can use Hibernation (http://en.wikipedia.org/wiki/Hibernation_%28computing%29). That's what I do :)

sneaker_ger
8th October 2014, 11:28
I want to know what went wrong with what I did. There are sync issues, and if I am right, the gap gets bigger after every 20 minutes or so (the same amount as the duration I separated the files by (using mkvmerge GUI, by the way)). I noticed during a very slow falling snow scene (which was coincidentally on the verge of going to the next file with still the same snow falling scene), there was a frame skip. I had my suspicions cleared after very well seeing the snow skip ahead by a tiny bit.

Mkvmerge is not reliable when it comes to splitting. For example many Blu-Rays use something called "Open GOP" and mkvmerge tries to split at keyframes that aren't really keyframes but the connection between gops. Now some frames have no access to their references anymore (because they end up in a different file) and thus might get skipped.

It's recommended to keep the source file intact and instead use for example AviSynth's Trim() function. That way all frames still have access to their references. The audio can be encoded as a large single segment without splitting.

And I agree with LoRd_MuldeR on the rest.