Closed jimfcarroll closed 1 year ago
Here are the changes I mentioned: https://github.com/jimfcarroll/ffmpeg-libav-tutorial/commit/fb6d196916379a4da87e9dc07d94dfd03196cf41
This seems to have resolved my issue in my own code: https://stackoverflow.com/questions/48578088/streaming-flv-to-rtmp-with-ffmpeg-using-h264-codec-and-c-api-to-flv-js
This example has been fantastic and I've used it as a guide to build a very robust system. The system decodes and remuxes almost anything to anything, including streaming rtmp to my server. I ran into an issue that I was hoping someone might point me in the right direction to resolve. My apologies if this is the wrong place for this.
I've recently been adding the ability to transcode/recode a stream of images when I ran across the problem described below. In order to see if it was something specific to my implementation I went back to this example and reproduced the issue using
3_transcode.c
I can transcode an mp4, minus audio, to an rtmp server, without a problem, using the following
ffmpeg
command line:ffmpeg -i input.mp4 -vcodec libx264 -an -f flv "rtmp://localhost:1935/live/feedly-id"
However, when I do this with a modified
3_transcode.c
I have a problem. I modified the code as follows:"flv"
as the third parameter toavformat_alloc_output_context2
StreamingParams
tosp.video_codec = "libx264";
with no other parameters.av_interleaved_write_frame
eventually (a few frames seem to go) fails with a-32
,Broken pipe
.If instead I set the destination to
/tmp/out.flv
it works and I can play the resulting file with VLC.Also, I can THEN send
/tmp/out.flv
to the rtmp server using-vcodec copy
and it ALSO works.If anyone can point me to a resource that will allow me to get streaming to work, I'd greatly appreciate it. I'll also submit a PR with a fix so the example will work with a streaming endpoint.
Thanks