1

In my sequencer I use media foundation to encode audio and video, but I also want to use ffmpeg to support more formats.

The ideal scenario is to use ffmpeg.exe with input of a raw WidthxHeight RGB or YUV stream and with raw pcm stream.

Perhaps in three steps. For example, a) encode video b) encode audio c) mux in an mp4. So my app can send data to ffmpeg stdin and get the stdout.

Is there a quick ffmpeg syntax way to do that? If not, I would have to use programmatically ffmpeg libraries.

2
  • What protocols do you intend to use to output the video and audio? For the video it appears you want to pipe it to ffmpeg. What about the audio?
    – llogan
    Commented Jan 24, 2020 at 19:25
  • @llogan input as a pcm Commented Jan 24, 2020 at 19:26

1 Answer 1

2

Use the rawvideo demuxer and the appropriate PCM demuxer (see ffmpeg -demuxers).

ffmpeg -y -f rawvideo -video_size 320x240 -framerate 25 -pixel_format yuv420p -i - -f s16le -sample_rate 44100 -channels 2 -i audio.pcm -shortest output.mp4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .