Log in

View Full Version : Keyframes at exact time


cold_hell
18th November 2012, 10:28
Hi guys,
Is it possible if you use only x264 to force the encoder to put I frame at exact time or frame ( for example at 959, 3116 , 30209, 32367 for chapters) I found old thread from 2007 where the answer is negative, but since all groups do it now I think that it is implanted already. Sorry that I ask such stupid question, but i dont find anything even in the full help. (Go to 40sec, "lol, there is no keyframe, now go and decode last 5-10seconds on 10-30mbps..." seeking killer)

And second question: Is it possible using only x264 to cut some moment form the video (example: cut 959-3116 without spiting it into 2 parts (--frames + --seek --frames ). I know that I can link them with mkv merge, so it is not so important but cutting is really hard since there is no keyframe at the right moment (question 1) and it suck for decoding

sneaker_ger
18th November 2012, 10:33
1. --qpfile (http://mewiki.project357.com/wiki/X264_Settings#qpfile) (You can omit the quantizer for recent x264 versions)

I don't quite understand your second question. You can indeed use --seek and --frames to encode only a specific part. Keyframes don't matter because you re-encode.

cold_hell
18th November 2012, 11:31
1. --qpfile (http://mewiki.project357.com/wiki/X264_Settings#qpfile) (You can omit the quantizer for recent x264 versions)

Thanks, works perfect for me as far I can see from the quick test.
I don't quite understand your second question. You can indeed use --seek and --frames to encode only a specific part. Keyframes don't matter because you re-encode.
If you encode first part with --frames and second one with --seek --frames you will get 2 files. I was just wondering if it is possible to encode them at one file.
But as I said it is not important.

LoRd_MuldeR
18th November 2012, 13:32
If you encode first part with --frames and second one with --seek --frames you will get 2 files. I was just wondering if it is possible to encode them at one file.
But as I said it is not important.

Use Avisynth/Vapoursynth input and then use the Trim() command and the "+" operator.

This way you can cut out arbitrary sections from your source video and join them together to a single continuous input stream for the encoder.

I don't think x264 alone can do that currently. It can only select one A...B section from the input (by using --seek and --frames).