1

My C++ app produces bitmaps with a timestamp. I can show these as a video in realtime, but i'd like to export them as h.264, using an ffmpeg process (command line) that the user has installed (to avoid requiring my app to be GPL'd).

Is what i'm asking even possible?

  • This should get you started... https://stackoverflow.com/a/46710797/2836621 – Mark Setchell Aug 16 '22 at 19:55
  • 1
    In case you don't want to execute your application with `|`: `./main | ffmpeg -y -f rawvideo`... , You may use [popen](https://man7.org/linux/man-pages/man3/pclose.3.html) (or `_popen`) function. Take a look at my [following answer](https://stackoverflow.com/a/72889919/4926757). The `timestamp` part may be problematic here. What do you intend to do with the timestamps? – Rotem Aug 16 '22 at 20:20
  • i don't need the timestamp, the frames come in with a predictable framerate and i just want the resulting mp4 file to have the correct frame rate. and yes, my app has a GUI, so would display a progress bar, so i'd need popen, and the ability to monitor stdout and stderr i suppose? – David M. Cotter Aug 16 '22 at 22:12
  • `popen` opens a pipe in one direction (`stdin` or `stdout` but not both). In case you have to monitor `stdout` and `stderr`, you have to execute FFmpeg as sub-process. The code is going to be more complicated. The implementation is going to be different for Windows and Linux. It is possible... – Rotem Aug 17 '22 at 11:17

0 Answers0