View Full Version : Partial x264 encoding. Possible?
samepaul
29th November 2009, 20:43
During 2-pass encoding on slow profile had electricity failure and 30 hours of encoding got lost. Almost.
I have 2-hours clip ready (11 minutes left to completion) and statistic files from 1st pass.
Is there any way to make x264 perform only 2nd pass on remaining 11 minutes?
RiCON
29th November 2009, 23:30
Maybe get the frame number from which you want to start encoding and then cut/merge the raw stream in mkvmerge? Preferably, starting on a keyframe, I guess?
samepaul
29th November 2009, 23:48
Yes, I've been thinking about this. But x264 give terrible quality. Since it has no indication that I decode from frame #17000 and not from 1st, thus uses stats/mbtree from 1st frame. Hence produces bad quality.
LoRd_MuldeR
29th November 2009, 23:55
I think even if you did manage to trim both stats files, the .stats and the .mbtree file, accordingly, which won't be trivial, you couldn't simply encode the rest as if it was the whole movie.
That's because x264 internal state, right before the electricity failure, was lost. And there's absolutely no way to restore it now...
Dark Shikari
30th November 2009, 05:41
You could do a CRF encode of the missing frames, cut the end off the first h264 file, then cat the h264 files back together.
samepaul
30th November 2009, 10:57
Dark Shikari Thanks. I did like you said, but now I have 1st part encoded in High5.1 profile and 2nd in High3.1 :)
Also, I did few tests and noticed different bitrate distribution. Also I noticed that in almost every case you suggest to use crf method over 2-pass. Does it mean that CRF is more appropriate from quality point of view?
Dark Shikari
30th November 2009, 11:06
Dark Shikari Thanks. I did like you said, but now I have 1st part encoded in High5.1 profile and 2nd in High3.1 :)
Also, I did few tests and noticed different bitrate distribution. Also I noticed that in almost every case you suggest to use crf method over 2-pass. Does it mean that CRF is more appropriate from quality point of view?CRF is always more appropriate unless you absolutely need a specific filesize.
CRF mode also means you can split a video as much as you want with no significant cost.
samepaul
30th November 2009, 13:03
And final question. How can i trim 1st part to exact frame and then join both parts?
MeteorRain
30th November 2009, 17:56
for the pre-process method: you trim the video in avs scripts by trim(0,16xxx) and encode another trim(16xxx+1, 0) by crf, and join them
for you already have the whole mp4: trim it by mp4box -splitx 0:ssss.ms for the mp4 and join it with the second crf file
mp4 cutting: mp4box -splitx 0:ssss.ms filename.mp4
where 0 and ssss.ms are seconds with miliseconds
mp4 joining: mp4box -cat 1stpart.mp4 -cat 2ndpart.mp4 whole.mp4
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.