문제

Hi I am new to x264 and know some basics. The encoding API routine used in x264 cli (x264.c) is summarized as:

  1. call x264_encoder_open and set up parameters.
  2. fetch a frame from input video and encode it with x264_encoder_encode.
  3. iterate 2. until input EOF or the given frame limit is reached.
  4. flush delayed frames.

My problem is: other than flush x264 encoder only once at the end of encoding process, is it possible or not to flush the delayed frames within step 2? For example, I want to flush the encoder manually every 20 frames (or a GOP frames) fed into x264_encoder_encode and resume the normal process when all delayed frames are encoded. Thus as a result the video will have several flush procedures.

Regards

도움이 되었습니까?

해결책

No, it is not possible. As once you send your first NULL-frame to x264_encoder_encode to flush frames it will stop all working threads for encoding so you will need to call x264_encoder_close/x264_encoder_open to start new encoding instance. Btw why you need to flush frames every 20 frames? Because I can't understand such use case.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top