GNOME Bugzilla – Bug 631855
[x264enc] encoder generates timestamps in the wrong order
Last modified: 2010-10-11 13:50:23 UTC
Hi, I get the timestamps in the wrong order when I set the key-int-max property. Try these pipelines: Timestamps are ok: gst-launch v4l2src -v ! videoscale ! videorate ! video/x-raw-yuv,width=640,height=480,framerate=1/1 ! x264enc ! fakesink Incorrect order: gst-launch v4l2src -v ! videoscale ! videorate ! video/x-raw-yuv,width=640,height=480,framerate=1/1 ! x264enc key-int-max=12 ! fakesink /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain ******* < (57790 bytes, timestamp: 0:00:01.000000000, duration: 0:00:01.000000000, offset: -1, offset_end: -1, flags: 256) 0x7fcc913c4530" /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain ******* < (57591 bytes, timestamp: 0:00:02.000000000, duration: 0:00:01.000000000, offset: -1, offset_end: -1, flags: 256) 0x7fcc913c40b0" /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain ******* < (75606 bytes, timestamp: 0:00:04.000000000, duration: 0:00:01.000000000, offset: -1, offset_end: -1, flags: 256) 0x17b0e10" /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain ******* < (51785 bytes, timestamp: 0:00:03.000000000, duration: 0:00:01.000000000, offset: -1, offset_end: -1, flags: 256) 0x7fcc9000c820" /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain ******* < (76187 bytes, timestamp: 0:00:06.000000000, duration: 0:00:01.000000000, offset: -1, offset_end: -1, flags: 256) 0x7fcc913c40b0" Tibor
I'd say those are correct (the gstreamer buffer timestamps are presentation timestamps (PTS)), and the encoder will be outputting buffers in decoding order (!= playback order). Needs double checking, but I don't really see an issue.
After some testing: - using an old libx264, default settings lead to no b-frames, and then timestamps are ascending (with or without key-int-max) - using a more recent libx264 (where default settings have b-frames), (PTS) timestamps are non-ascending (with or without key-int-max). So, comment above applies.