Search code examples
ffmpegrtmp

What do the options in ffmpeg mean?


I don't understand what these options ( -r 30 -s 1280x720 -preset superfast -profile:v baseline) mean , searched but couldn't find , hope someone can help :

ffmpeg -i rtmp://localhost:1935/stream/$name
          -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 2500k -f flv -g 30 -r 30 -s 1280x720 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_720p2628kbs

Solution

  • From https://ffmpeg.org/ffmpeg.html

    -r[:stream_specifier] fps (input/output,per-stream)
    Set frame rate (Hz value, fraction or abbreviation).

    -s[:stream_specifier] size (input/output,per-stream)
    Set frame size.

    From https://trac.ffmpeg.org/wiki/Encode/H.264

    Preset
    A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset.

    Profile
    The -profile:v option limits the output to a specific H.264 profile. You usually do not need to use this option and the recommendation is to omit setting the profile which will allow x264 to automatically select the appropriate profile.