[Libav-user] Using ffmpeg libraries to stream pre-encoded h264 via rtmp

Steve Green steve.green at flosports.tv
Tue Feb 14 03:45:57 EET 2017


Is it possible to setup a format context, and add a stream such that I can create my own AVPacket with H264 encoded frames, av_interleaved_write_frame() into that stream and have it all go out as rtmp?

I’ve tried to figure it out, but Im not sure it’s possible.  For example, what codec and settings would I use for the stream given that I don't actually need ffmpeg to do any H264 encoding?  I see that there’s a “copy” codec for use on the command line but I’m not sure if I that’s what I want to use with avcodec_find_encoder().

Do I need to call avcodec_encode_video2 or can I simply create my own AVPacket with the H264 frames in the data/size/flags?

If I can get this to work, I’ll mux in an audio stream but I’d be happy just to see basic video working first.

Any suggestions or starting points would be greatly appreciated.

Thanks..


More information about the Libav-user mailing list