* [FFmpeg-devel] Demuxing and decoding raw RTP stream
@ 2022-02-05 18:09 Kevin Wang
0 siblings, 0 replies; only message in thread
From: Kevin Wang @ 2022-02-05 18:09 UTC (permalink / raw)
To: ffmpeg-devel
Hi, I'm implementing a pipeline where I receive inbound RTP packets in
memory but I'm having trouble figuring out how to set up libavformat to
handle/unwrap the RTP packets.
I have all relevant information about the underlying codec necessary but
since it's h264 I cannot simply strip the RTP header trivially. I create
the input context with goInputFunction writing one packet per invocation.
void *readbuf = av_malloc(1500);
AVIOContext *avioreadctx = avio_alloc_context(readbuf, 1500, 0,
transcoder, &goInputFunction, NULL, NULL);
AVFormatContext *inputctx = avformat_alloc_context();
inputctx->pb = avioreadctx;
inputctx->flags |= AVFMT_FLAG_CUSTOM_IO;
When I open it with avformat_open_input(&inputctx, NULL, NULL, NULL) it
repeatedly calls the read function but doesn't actually progress. I suspect
because the RTP stream itself does not have enough information to fully
describe the codec? If I leave this open out, then av_read_frame(inputctx,
input_packet) down the road segfaults, I'm guessing because the input
context is uninitialized.
So to my question, is it possible to set the codec details that the SDP
would typically set, but manually?
I'm looking for an example of how to manually configure the AVFormatContext to
consume RTP packets without an SDP and setting up a UDP port listener.
Thanks,
Kevin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-05 18:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-05 18:09 [FFmpeg-devel] Demuxing and decoding raw RTP stream Kevin Wang
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git