[Libav-user] Converting ts to DASH using libavformat

Simon Brown simon.k.brown at gmail.com
Tue Feb 25 19:05:54 EET 2020


I'm trying to convert an incoming transport stream to DASH without
re-encoding.

I've done this using two separate ffmpeg commands and it works, but as each
instance of FFMpeg spends time locking onto the stream, finding the first
I-frame, etc the resulting latency is unacceptable.  I thought I could
streamline this somewhat by writing it using the libav libraries that come
with FFmpeg.

I've taken the demux_decode.c example and receive the stream.  I don't
decode it, I just get a packet from the stream using:

av_read_frame(fmt_ctx, &pkt)

Once read, I try and write it to the stream using:

   ret = av_interleaved_write_frame(oc, &pkt);

having setup oc as an output context for muxer "dash".

    avformat_alloc_output_context2(&oc, NULL, "dash", filename);

However, I seem to have missed some vital steps, because the dash muxer
responds with:
Output #0, dash, to 'vid.mpd':
    Stream #0:0: Unknown: none

The muxing.c example is all about taking some generated frames and encoding
them before sending them out and that sets up a codec context which is
added to the dash muxer, but I don't want a codec context, because I don't
want to encode an already encoded stream.

Any help would be greatly appreciated.

Regards,
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200225/e884de5e/attachment.html>


More information about the Libav-user mailing list