[Libav-user] Writing Audio AVPacket without resampling

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Mar 25 00:21:04 EET 2020


Am Mo., 23. März 2020 um 08:51 Uhr schrieb
<sebastian.wichmann at karlsruhe-it-solutions.com>:

> The command looks like this:
> ffmpeg -f gdigrab -framerate 30 -i desktop -f dshow -i audio="Mikrofon (Realtek High Definition Audio)" test.mp4

This command is (very often!) reading a frame from memory, converting
its colour space,
encoding the frame on the cpu and writing the encoded frame to disk.
The tiny (tiny, tiny) bit of work for resampling s16 to fltp and
encoding it into aac
is ridiculous in comparison. If you want to spare the time for
resampling (and audio
encoding) you can use pcm_s16be as encoder, this makes the output file bigger
and puts a little more pressure on I/O.
It might not be easy to measure the difference though;-)

Unrelated: You are using yuv444p as colour space for your h264 encoding,
this colour space cannot be played back unless your player is FFmpeg-based.

Carl Eugen


More information about the Libav-user mailing list