Le lun. 11 août 2025 à 19:21, Romain Beauxis
<romain.beau...@gmail.com> a écrit :
>
> Le lun. 11 août 2025 à 17:31, Yalda <mart...@proxyid.net> a écrit :
> >
> > Hi Romain,
>
> Hi!
>
> > I can try to help out here.
> > I am not familiar with the OGG spec but I can at least help with
> > reviews/facilitate to a degree, and it's free so I can read if needed.
> >
> > It seems you are trying to fix issues in and improve OGG support.
> > Can you give me a brief summary of your goals?
> > (i.e. what should I look at first to assist?)
>
> Great, thank you so much for taking the time.
>
> Got the current work, I would like to improve ffmpeg support for ogg
> stream chaining.
>
> # Ogg chaining
>
> The documentation for this feature is here:
> https://xiph.org/ogg/doc/oggstream.html
>
> Ogg stream chaining is used in particular to send a sequence of
> tracks. Each time a track ends, the current bitstream is terminated
> and a new one created. This is also required to pass in-band metadata.
>
> In practice, ogg chaining works pretty much like concatenating ogg files.
>
> Historically, this spec has proven to be a pretty bad design. There
> are very few tools handling this properly. Most of them treat the end
> of the first logical bitstream as an end of file.
>
> However, and furthermore unfortunately, ogg is still pretty popular
> for audio streaming, especially using icecast. In particular it is the
> only container that currently supports lossless codec (flac) with
> in-band metadata.
>
> # In ffmpeg
>
> In ffmpeg, support for chained streams is essentially missing. In the
> following, I'm talking about the state of the code before I started
> working on it.
>
> 1- Most decoders are able to keep decoding after the first logical
> bitstreams. However, in most cases, secondary and later metadata are
> lost.
>
> 2- The demuxer outputs ogg header packets as ffmpeg packets from
> secondary and further streams. These packets should be suppressed by
> the demuxer and instead passed as extradata.
>
> 3- PTS and later DTS of secondary and further streams are
> discontinuous: they restart from their initial value.

I meant the other way :-) DTS and then PTS

> 4- It is currently not possible to do a ffmpeg -c copy copy of
> sequentialize ogg streams.
>
> I'm trying to fix those 4 points.
>
> The work that I have been doing has been focused on the most popular
> codecs, namely opus, flac and vorbis. I'm happy to extend to more but,
> at this point, I'd consider all the other one as deprecated
> personally.
>
> Issue #1 is partially addressed with some patches current in the code
> base and some patches pending.
>
> But, first, I'd like to focus on issue #2 because it is almost complete.
>
> Currently, issue #2 has been addressed by a series of patches reviewed
> and merged by Michael and Lynne.
>
> 2431fd0b275: introduce a dump utility to track and check changes to
> the bitstreams on each patch
> 6d54af6599 and a9d39d6eb9: change the meaning of ogg_codec->packet
> return value of 1 to make it possible to direct the demuxer to skip
> some decoded packets
>
> At this point, the stage is ready to start skipping ogg header packets:
> 2fb6416dd0: skip ogg header packets in ogg/flac streams
> 9c5ed57f94: skip ogg header packets in ogg/opus streams
> 574f634e49: skip ogg header packets in ogg/vorbis streams
>
> The last one was clearly erroneous and reverted by Andreas Rheinhardt
>
> The PR here: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20026 is the
> fixed version, following Andreas Rheinhardt feedback.
>
> The fixed patch packs all 3 vorbis header into a bytestream structure,
> passes it as extra data and uses it on the decoder side.
>
> Following Michael's review, support for demuxed ogg headers is kept as
> legacy in case libavcodec is linked with an older version of
> libavformat.
>
> A new decoding routine is added to handle the new extradata-based
> header packets.
>
> Let me know if that is enough information for you to help and thanks again!
> -- Romain
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to