0

Is there any c++ video library to convert videos to flv video?

I searched on google I found flvdev.com but it's not open source (it needs purchasing). I also tried libavcodec, but flv codec doesn't work.

(Now I'm fetching frames from a video monitor, then use libavcodec to encode them to mpg and finally call "ffmpeg" command to convert them to flv)

Mark Ma
  • 1,342
  • 3
  • 19
  • 35

1 Answers1

1

You can try ffmpeg. It seems it supports the flv format:

https://github.com/FFmpeg/FFmpeg

http://www.ffmpeg.org/download.html

Here are some examples of how to use the compiled program, but being open source, you can integrate it into your work:

How can I achieve the best overall FLV quality with FFMPEG?

http://www.thornock.us/wordpress/archives/172

Community
  • 1
  • 1
asalic
  • 949
  • 4
  • 10
  • Sorry that I didn't tell enough details, I need to convert raw video frame to flv frame. ffmpeg can only convert files (Please check the updated question) – Mark Ma Nov 26 '13 at 08:31
  • @MarkMa Okay, then why don't you modify ffmpeg to accept buffers instead of images? It already has the capability to use images as an input an generate flv: http://ffmpeg-users.933282.n4.nabble.com/Use-list-of-files-as-input-for-ffmpeg-td940933.html you could modify the source shuch that it loads the data directly from the memory. – asalic Nov 26 '13 at 08:46
  • Thanks for the help. I searched for a while but cannot find way to feed memory stream as input to ffmpeg.. – Mark Ma Nov 26 '13 at 11:46
  • @MarkMa I was saying to modify ffmpeg to accept the buffer, that is instead of reading the file you provide from command line, it should use directly the buffer, meaning that you will have to search where in the code ffmpeg reads the file and adapt that part to use your memory, e.g. it reads the file in a struct, you should be able to manually fill that struct with your data – asalic Nov 26 '13 at 14:00
  • Sorry, I misunderstood your meaning.. I will read the ffempg code, thanks – Mark Ma Nov 27 '13 at 01:07
  • It works now! I only implemented the video tag and basic flv header. Thanks! – Mark Ma Nov 27 '13 at 09:39