Log in

View Full Version : x264 output video in chunks before muxing?


grad
18th July 2008, 03:02
I know it's possible, I just can't figure out how to do it. I was told that a custom x264.exe could be used to output the 2nd pass video .mkv in chunks or segments much in the same way virtualdub does for xvid avi's(I could later mux them myself locally or on a remote machine). Is there anyone that can help?

poisondeathray
18th July 2008, 03:33
In MeGUI, if you push the autoencode button, there is a "splitting" drop down menu. You can enter various sized, default is "no splitting"

You can also split finished .mkv's with mkvmergegui

grad
18th July 2008, 04:03
that's only for splitting the muxed final mkv, I want to split the video before it's muxed (output it in pieces as it's encoding)

poisondeathray
18th July 2008, 04:53
Ok I misunderstood you. You want raw .264 video. (no audio)

One way you could do it is to use MeGUI's avs cutter, create avs scripts per specified segment, queue them up.

If you want matching audio I think you have to save the cuts file beforehand and use the audio cutter

It's not as simple as vdub's "save segmented avi", but if you are willing to put up with the x264 vfw version in avi, you can do it in vdub.

talen9
18th July 2008, 15:05
One way you could do it is to use MeGUI's avs cutter, create avs scripts per specified segment, queue them up.

Actually, I don't think that's what he wants to do ... especially because, doing this, you're encoding a lot of shorter clips instead of the complete one.

Only using CRF encoding this will have (more or less) the same final encoded file, it's obviously not possible to multipass-encode the clip on a whole if you split it in that way.


I suppose the OP is referring to a solution encoder-dependent, not source-dependent ....

poisondeathray
18th July 2008, 19:31
Actually, I don't think that's what he wants to do ... especially because, doing this, you're encoding a lot of shorter clips instead of the complete one.

Only using CRF encoding this will have (more or less) the same final encoded file, it's obviously not possible to multipass-encode the clip on a whole if you split it in that way.


I suppose the OP is referring to a solution encoder-dependent, not source-dependent ....


This encodes in segments (e.g. frame 0,100 for 1st, 101-200 for 2nd etc...). You can do different sized segments if you wanted, and even the entire film.

It works, I tried it with 2-pass. Even appends with avidemux or yamb. (since encoding characteristics are the same). You can reproduce the whole video when joined.

It's just very tedious if you have a lot of cuts.

Comatose
18th July 2008, 20:17
It might be less efficient than encoding the entire video at once, since there's the entire AQ thingie... and then there's Bframes, etc...
mp4box can demux AVC from mp4 into individual frames :p

talen9
19th July 2008, 00:48
This encodes in segments (e.g. frame 0,100 for 1st, 101-200 for 2nd etc...). You can do different sized segments if you wanted, and even the entire film.

It works, I tried it with 2-pass. Even appends with avidemux or yamb. (since encoding characteristics are the same). You can reproduce the whole video when joined.

It's just very tedious if you have a lot of cuts.

Comatose already pointed out was I was trying to convey, but I'll try to explain myself better nonetheless :p

I know that splitting the AVS works and encoding them separately works, and that you can join all the fragments at the end; but from the encoder POV, that's absolutely not the same thing, especially if you encode in 2-pass mode.

If you do it your way, you'll be making the encoder do 2 passes of each fragment on its own. The whole point of making two passes (blunty put) is to let the encoder decide where to allocate more bits and where to subtract them, with the constraint that the clip that you're encoding has to be of a given size; splitting the input stream via AVS cutting means "limiting the horizon" of the encoder, which cannot subtract bits from a fragment to allocate them to a more hungry one ;)

Moreover, I'm not so sure that the target bitrate would be hit with the same precision as while encoding the complete stream.

I think that what the OP is asking for, is a feature which can only be found on the encoder side of the process.



All this said, it's altogether true that I'm not at all familiar with MeGUI AVS Cutter .... so it's completely possible that I told a lot of BS :o

Comatose
19th July 2008, 10:18
I'm pretty sure all it does is give you a GUI to select a start and end pos and then fills in the parameters for trim() :3

foxyshadis
22nd July 2008, 07:20
Run a first pass, then set up a series of custom second passes with various --seek and --frames options. I forget whether it was updated to read frames from the stats file correctly, or if it still does from the beginning no matter where you seek to; you might have to chop the stats up.

You'll have to run the second passes from I frames in the stats file though.