Hi,
I’m encountering some issues with seeking and timestamp modifications on VP9 buffers when using vp9alphadecodebin
.
Context:
- I’ve implemented a custom GStreamer source bin that wraps a
filesrc
andmatroskademux
. It modifies the PTS/DTS of buffers to use Unix Epoch time on thematroskademux
source pad. - This bin is used in a pipeline where I send frame-accurate seek events (in Unix timestamps) to process specific time intervals.
- The setup works perfectly for:
- H.264 buffers with
avdec_h264
. - VP9 buffers with
vp9dec
(but this loses alpha transparency, which I need).
- H.264 buffers with
Problem: When using vp9alphadecodebin
, the pipeline hangs during seeks - no buffers are passed to the srcpad on vp9alphadecodebin
and I fail to query the pipeline state.
I suspect this may be due to a queue filling up, but I see no obvious warnings or errors in the debug logs. If I skip the timestamp modifications on both buffers and seek events, the pipeline works fine. This to me suggests that the issue is related to the timestamp handling
Observations:
- Using
vp9alphadecodebin
, I receive two seek events with the sameseqnum
, whereas with other decoders, this does not happen. I currently ignore the second event. - The problem seem to only occurs when modifying timestamps.
Implementation Details:
- Seek Handling: On the
srcpad
, I intercept seek events, perform an internal seek (sendingflush-start/stop
), and dynamically add thefilesrc
-matroskademux
elements for the requested time. After receiving thestream-start
event, I forward the intercepted seek segment event downstream. Repeated seek events with the sameseqnum
are ignored. - Buffer Retimestamping: I adjust the PTS/DTS of buffers on the
matroskademux
source pad.
Questions:
- Is there something specific to vp9 alpha buffers or
vp9alphadecodebin
that requires special handling during timestamp modification or seek events? - Does the alpha metadata also need some special modification other than setting pts/dts on the buffer?
- Any other suggestions to get around my problem?
Pipeline:
compositor name=mixer ! videoconvert ! videoconvert ! x264enc ! queue ! mpegtsmux ! filesink location=out.ts bpfdemuxbin uri=playlist name=demuxer ! queue name=queue ! vp9parse name=parser ! vp9alphadecodebin name=dec ! videoconvert ! mixer.
Bpfdemuxbin is the custom bin that parses a playlist and wraps the filesrc-matroskademux
Any help is greatly appreciated!