webmmux byte offset

F Weers dedomme123 at gmail.com
Wed May 11 02:50:54 UTC 2022

Hi all,

summary: I have a pipeline that writes any video (with audio) to webm
format (in which every frame is a keyframe), I want to know the byteoffsets
of the (key-)frames of the written file.

First of all, thanks for the awesome Rust support of GStreamer. I'm quite
new to Rust, but it feels very natural to convert a console-command to the
Rust equivalent!
I have the following (simplified) pipeline:

gst-launch-1.0 webmmux name=mux ! filesink location="output.webm"
filesrc location="input.mp4" ! decodebin name=demux \
demux. ! videoconvert ! videoscale ! videorate ! vp9enc !  mux.video_0 \
demux. ! audioconvert ! audioresample ! opusenc ! mux.audio_0

It converts an mp4 file to a webm file (I started with this ffmpeg command:
'ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -g 1 -b:v 0 -b:a 128k -c:a
libopus output.webm'). This works great. In my code, I also set the
keyframe-max-dist to 1, which means that every frame is a keyframe (the '-g
1' argument in the ffmpeg command). Now, I'd like to get the byte offsets
of the key-frames, so I can directly load the segments from disk. While I
can get those offsets using https://github.com/acolwell/mse-tools , I'd
like to get them directly while converting an input video to its webm
version with only keyframes.

Thank you in advance! Let me know if something is unclear.

Floris Weers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220510/e003449e/attachment.htm>

More information about the gstreamer-devel mailing list