Skip to content

Recording examples

Tip

Feel free to contact us at contact@datastead.com if a command line is failing or not working properly!

a) H264 to MP4, using the OpenH264 software encoder

MPEConfig->SetCommandLine (L"ffmpegLGPL.exe -threads 8 -i %PIPE% -c:v h264 -profile:v baseline "
                           L"-allow_skip_frames 1 -loopfilter 0 -b:v 1M -an -f mp4 myoutputfile.mp4");
  • -c:v h264: use the H264 software encoder as video codec, followed by the codec settings (-b:v 1M = video bitrate of 1 Mbit/s),
  • -an: no audio.

b) H264 + AAC to MP4, using the NVIDIA hardware encoder

MPEConfig->SetCommandLine (L"ffmpegLGPL.exe -i %PIPE% -c:v h264_nvenc -preset fast -rc 1 -cbr 1 -b:v 200M "
                           L"-c:a aac -ab 128k -ac 2 -ar 44100 -f mp4 myoutputfile.mp4");
  • -c:v h264_nvenc: compress the video with the NVIDIA H264 hardware encoder, followed by the NVENC settings (-cbr 1 = constant bitrate, -b:v 200M = video bitrate of 200 Mbit/s),
  • -c:a aac: compress the audio with the AAC encoder, followed by the audio settings (-ab 128k = audio bitrate of 128 kbit/s, -ac 2 = 2 channels, -ar 44100 = sample rate of 44100 Hz).

c) HEVC (H265) + AAC to MP4, using the NVIDIA hardware encoder

MPEConfig->SetCommandLine (L"ffmpegLGPL.exe -i %PIPE% -c:v hevc_nvenc -preset fast -rc 1 -cbr 1 -b:v 200M "
                           L"-c:a aac -ab 128k -ac 2 -ar 44100 -f mp4 myoutputfile.mp4");

See also the Streaming examples and the Command-line syntax.