ffmpeg-cpp icon indicating copy to clipboard operation
ffmpeg-cpp copied to clipboard

OpenCV and RTMP

Open TimTreurniet opened this issue 6 years ago • 4 comments

Hi, ffmpeg for cpp is quite challenging so thanks. I was wondering if this could be used as well using openCV Mat as input, and RTMP output

TimTreurniet avatar Jul 03 '19 13:07 TimTreurniet

You're going to have to create your own video source class to convert the OpenCV mat to a format that ffmpeg understands (see https://github.com/Raveler/ffmpeg-cpp/blob/master/source/ffmpeg-cpp/ffmpeg-cpp/Sources/RawVideoDataSource.cpp for an example). I don't know about RTMP - does ffmpeg support this?

Raveler avatar Jul 04 '19 09:07 Raveler

@TimTreurniet I think this repo does exactly what you are looking for

juniorxsound avatar Jul 27 '19 15:07 juniorxsound

@juniorxsound This is what I have been using so far. However I do not believe it supports audio streams, which is something I need since my project requires youtube streaming. Somehow adding an empty audio stream would be fine which I'm currently doing using a ffmpeg session in command line. This adds an unnecessary step with encoding and decoding. I find ffmpeg in cpp a difficult subject to get into...

TimTreurniet avatar Jul 29 '19 10:07 TimTreurniet

I have added support for audio streams in the latest version of ffmpeg-cpp.

Raveler avatar Aug 08 '19 15:08 Raveler