[x264-devel] hybrid frame source

YIRAN LI mrfun.china at gmail.com
Fri Jan 13 13:59:00 CET 2017


2017-01-13 17:41 GMT+11:00 BugMaster <BugMaster at narod.ru>:

> On Fri, 13 Jan 2017 16:12:59 +1100, YIRAN LI wrote:
> > 2017-01-13 15:08 GMT+11:00 YIRAN LI <mrfun.china at gmail.com>:
>
> > Hi guys,
>
> Hi.
>
> > I'm trying to convert a sequence of video frames, first half 30
> > fps, second half 25 fps. Can X264 encode such frame sequence and output
> timestamps same as input.
>
> > I mean if the time stamps of frames sent to x264 is like:
>
> > 0, 0.333, 0.666, 0,999, 1.25, 1,5, 1.75 2.0
>
> This looks like 3- and 4-fps sequence. For 30- ans 25-fps time stamps
> should be:
> 0, 0.0333(3), 0.0666(6), 0.1, 0.14, 0.18, 0.22, 0.26
>
> > can x264 accept them? will 8 encoded frames be output? will output
> > frames duration still 0.333, 0.333, 0.333, 0.333 then 0.25, 0.25, 0.25,
> 0.25?
>
> > Thanks
>
> > ​Hi, just to clarify that I'm not using the x264 command line tool,
> > I'm using the API. I think I can't use force-cfr or -fps, but I also
> > can't set timebase in this case, can I ?​
>
> For 3- ans 4-fps you can use VFR encoding with timebase 1/12 and i_pts of:
> 0, 4, 8, 12, 15, 18, 21, 24
>
> For 30- ans 25-fps you can use VFR encoding with timebase 1/150 and i_pts
> of:
> 0, 5, 10, 15, 21, 27, 33, 39
>
> ​Great thanks for this.


   1. So timebase 1/150 is set when I open the encoder, i_pts is set on the
   x264_picture_t I send to encoder, correct?
   2. By "time stamps are part of the container" you mean it's ok to encode
   without setting the i_pts and I can set it before sending encoded frames to
   muxer? If true, one thing I'm curious is, will every frame sent to encode
   function sure to return one frame? otherwise if 2 frames encoded to 1
   frame, then what timestamp should I assign to the encoded frame?  If every
   frame sent to encode function is sure to yield a frame, just assign
   timestamp of the uncompressed frame to the encoded frame is ok?
   3.  30 + 25 hybrid can be precisely expressed by 1/150, how if the
   possible frame rate unknown? Set to a high value like 1/1000?

​

> Anyway time stamps are really part of container not of raw H.264 so if
> you don't need VFR ratecontrol than you can encode it at any fps and
> mux with correct time stamps latter.
>
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> https://mailman.videolan.org/listinfo/x264-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20170113/5d8b7d8c/attachment.html>


More information about the x264-devel mailing list