formshaa.blogg.se

Ffmpeg h264 streaming
Ffmpeg h264 streaming










ffmpeg h264 streaming

$ ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -framerate 30 -video_size 1280x720 \ If you want the output video frame size to be the same as the input: See FFmpeg Wiki: Capture Desktop for additional examples. For example, if your input is -framerate 30, then use -g 60.Įxamples below use x11grab for Linux. Use a 2 second GOP (Group of Pictures), so simply multiply your output frame rate * 2. Refer to your streaming service for the recommended buffer size (it may be shown in seconds or bits). You will have to experiment to see what looks best for your content. If you use -maxrate 960k then use a -bufsize of 960k-1920k. bufsize sets the buffer size, and can be 1-2 seconds for most gaming screencasts, and up to 5 seconds for more static content.

  • Note that the claimed data rate pay your ISP for may not actually be what you get.
  • ffmpeg h264 streaming

    Refer to your streaming service for any limitations that may apply.

    ffmpeg h264 streaming

    If you have a sane upload rate, or do not know what to choose then a -maxrate value of up to 3000k-4000k will probably be fine if your upload rate can handle it (depending on your input complexity and -video_size).Audio will consume 128 kbit/s (64k/channel for stereo, but you can of course use a different audio bitrate) leaving ~692 kbit/s for video: this is your -maxrate value. Assuming your upload rate is 1024kbit/s (1 megabit/s), and assuming you can reliably utilize 80% of that = 820 kbit/s.Try -preset veryfast if you are unsure of what to choose, then watch the console output or the video to see if the encoder is keeping up with your desired output frame rate: if it is not then use a faster preset and/or reduce your width x height or frame rate.Īnytime you are encoding video with bandwidth as a limiting factor you should be using VBV (Video Buffer Verifier) with the -maxrate and -bufsize options: Use the slowest preset you can: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo. This provides the compression to encoding speed ratio. Refer to the documentation of your specific streaming service for bitrate recommendations.

    ffmpeg h264 streaming

    Make sure you understand what they mean, and visually inspect your output. by customizing the -b:v/ -crf, -preset, -maxrate, -bufsize, and -g options. Note: You may have to tweak the commands and settings listed below, e.g.












    Ffmpeg h264 streaming