User:Joger/FFmpeg: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== FFProbe ==
== FFProbe ==
FFProbe is used to inspect media, for example to view format or stream information. To view a file's format and stream information, you can use the following command line. It will print out information about the file's individual streams, such as video and audio streams, and also the container format.
FFProbe is used to inspect media, for example to view format or stream information. You can use the following command line to view a file's format and stream information. It will print out information about the file's streams, such as video and audio streams, as well as the container format.
  ffprobe -v error -show_streams -show_format -print_format json <name_of_media>
  ffprobe -v error -show_streams -show_format -print_format json <name_of_media>
Useful options
Useful options  


* &lt;code&gt;-v error&lt;/code&gt; suppresses FFprobe's header and decoding information so that we only see the interesting output information.
*<tt>-v error</tt> suppresses FFprobe's header and decoding information, so we only see the interesting output information.
* &lt;code&gt;-print_format json&lt;/code&gt; argument makes the output easier to read.
*<tt>-print_format json</tt> argument makes the output easier to read.
* &lt;code&gt;-select_streams v&lt;/code&gt; argument will only print '<nowiki/>'''v'''ideo' streams.  It can be replaced by &lt;code&gt;a&lt;/code&gt; to show only '<nowiki/>'''a'''udio' streams, or &lt;code&gt;s&lt;/code&gt; to show only ''''s'''ubtitle' streams.
*<tt>-select_streams v</tt> argument will only print video streams.  It can be replaced by <tt>a</tt> to show only ''''a'''udio' streams, or s to show only ''''s'''ubtitle' streams.


== FFMpeg ==
==FFMpeg ==
Low latency streaming
Low latency streaming
  > mediamtx
  > mediamtx
  > ffmpeg -filter_complex ddagrab=video_size=1024x890:output_idx=0:framerate=60,hwdownload,format=bgra -fflags nobuffer -vcodec libx264 -tune zerolatency -f rtsp rtsp://127.0.0.1:8554/webcam.h264
  > ffmpeg -filter_complex ddagrab=video_size=1024x890:output_idx=0:framerate=60,hwdownload,format=bgra -fflags nobuffer -vcodec libx264 -tune zerolatency -f rtsp rtsp://127.0.0.1:8554/webcam.h264
  > ffplay rtsp://127.0.0.1:8554/webcam.h264 -fflags nobuffer -flags low_delay -framedrop
  > ffplay rtsp://127.0.0.1:8554/webcam.h264 -fflags nobuffer -flags low_delay -framedrop

Revision as of 10:45, 25 August 2024

FFProbe

FFProbe is used to inspect media, for example to view format or stream information. You can use the following command line to view a file's format and stream information. It will print out information about the file's streams, such as video and audio streams, as well as the container format.

ffprobe -v error -show_streams -show_format -print_format json <name_of_media>

Useful options

  • -v error suppresses FFprobe's header and decoding information, so we only see the interesting output information.
  • -print_format json argument makes the output easier to read.
  • -select_streams v argument will only print video streams. It can be replaced by a to show only 'audio' streams, or s to show only 'subtitle' streams.

FFMpeg

Low latency streaming

> mediamtx
> ffmpeg -filter_complex ddagrab=video_size=1024x890:output_idx=0:framerate=60,hwdownload,format=bgra -fflags nobuffer -vcodec libx264 -tune zerolatency -f rtsp rtsp://127.0.0.1:8554/webcam.h264
> ffplay rtsp://127.0.0.1:8554/webcam.h264 -fflags nobuffer -flags low_delay -framedrop