Overview
- Ffplay is a multimedia player based on the FFmpeg Library and SDL Library development. Its main purpose is to test the various APIs of ffmpeg, such as Codec/format/filter and so on.
- Mastering the design logic of Ffplay is very helpful for player developers to improve their experience. The ijkplayer of the Beep is based on the development of Ffplay two times. Command format
ffplay [Options] [Input_url]
Main options
Options |
Description |
-X Width |
Force display of broadband. |
-Y Height |
Force display height. |
-S size |
Frame size settings Display frame storage (WxH format), only available for videos that do not contain frame size (WxH) like original YUV. This parameter has been deprecated, please try to replace it with-video_size |
-fs |
Starts in full-screen mode. |
-an |
Disable audio (do not play sound) |
-vn |
Disable video (do not play video) |
-sn |
Disable subtitles (do not display subtitles) |
-ss POS |
Based on the set of seconds to locate the drag, note the time unit: such as ' seconds ', ' 12:03:45 ', hours, minutes and seconds, ' 23.189 ' 23.189 second |
-T duration |
Set playback video/audio length, time units such as-SS options |
-bytes |
Position the drag by byte. |
-seek_interval interval |
Custom left/Right key anchor drag interval (in seconds), default value is 10 seconds |
-nodisp |
Close the graphical display window and the video will not display |
-noborder |
No Border window |
-volume Vol. |
Sets the start volume. Volume range [0 ~100] |
-F FMT |
Forces parsing using the format of the setting. Like-f S16le |
-window_title Title |
Set the window caption (default = input file name) |
-loop number |
Set the number of playback cycles |
-showmode mode |
Set display mode, available mode values: 0 display video, 1 display audio waveform, 2 display audio spectrum. The default is 0, and automatically selects 2 if the video does not exist. |
-VF Filtergraph |
Set up a video filter |
-af Filtergraph |
Set Audio Filters |
-I. Input_url |
Input_url |
|
|
|
|
|
|
|
|
Advanced options
Options |
Description |
-PIX_FMT format |
Format the pixel format. This option has been deprecated and is beneficial for private options, Try-pixel_format |
-stats |
Print multiple playback statistics, including display stream duration, edit xxx parameters, current position in the stream, and audio/video sync difference. Enabled by default, you need to specify-nostats to explicitly disable it. |
-fast |
Multimedia compatibility optimization of non-standardized specifications |
-genpts |
Generate PTS. |
-sync type |
The sync type sets the master clock to Audio (Type=audio), Video (type=video), or external (type=ext), which is the main clock by default. |
-ast Audio_stream_specifier |
Specifies an audio stream index, such as-ast 3, which plays stream index 3 |
-vst Video_stream_specifier |
Specifies the video stream index, such as-vst 4, which plays stream index 4 |
-sst Subtitle_stream_specifier |
Specify a caption stream index, such as-sst 5, with a stream index of 5 subtitle stream |
-autoexit |
Exit after the video has finished playing. |
-exitonkeydown |
Keyboard Press any key to exit playback |
-exitonmousedown |
Mouse Press any key to exit playback |
-codec:media_specifier Codec_name |
Mandatory use of the set multimedia Xxx,media_specifier available values are a (audio), V (video) and S subtitles. such as-codec:v h265 mandatory video with h265 decoding |
-acodec Codec_name |
Force audio decoding with set audio xxx |
-vcodec Codec_name |
Force video decoding with set video xxx |
-scodec Codec_name |
Force subtitle decoding with set caption xxx |
-autorotate |
Automatically rotate video based on file metadata. Enabled by default, use-noautorotate if you want to disable |
-framedrop |
If the video is out of sync, the video frame is discarded. The primary clock is turned on by default when it is not a video clock. Use-noframedrop If you want to disable |
-infbuf |
The input buffer size is not limited. Read as much data as you can from the input as quickly as possible. It is enabled by default when the live stream is played, and data may be discarded if the data is not read in time. This option will not limit the size of the buffer. Use-NOINFBUF If you want to disable |
Playback controls
Options |
Description |
Q, ESC |
Exit playback |
F |
Full Screen Toggle |
P, SPC |
Time out |
M |
Mute Toggle |
9, 0 |
9 volume reduction, 0 increase volume |
/, * |
/decrease volume, * increase volume |
A |
Cycle through audio streams |
V |
Cycle through video streams |
T |
Cycle through a caption stream |
C |
Cycle through programs |
W |
Cycle switch Filter or display mode |
S |
Play Frames by frame |
Left/right |
Drag backward/forward for 10 seconds |
Down/up |
Drag backwards/forwards for 1 minutes |
Page Down/page up |
Drag the previous/next. Or, if no chapters are dragged backwards/forwards for 10 minutes. |
Right-click |
Drag a file that corresponds to a percentage of the display width to play |
Left mouse button Double-click |
Full Screen Toggle |
Application example to play media files
- To open a live stream, you can use the command
Ffplay-window_title "rtmp Stream" rtmp://202.69.69.180:443/webcast/bshdlive-pc
- Play a video from 2 seconds, play for 10 seconds, automatically exit Ffplay after playback is complete, the player's window title is "Test Time",
Ffplay-window_title "Test Time"-ss 2-t 10-autoexit Test.mp4
Forcing the use of mp3xxx to decode AAC audio will cause an error:
Ffplay-acodec mp3 Test.mp4
- When more than one program appears in the video stream, the playback program differs from the normal playback method, specifying the corresponding stream, which can be specified by the VST, AST, SST parameters, for example, to play the audio and video stream in program 13, as specified by the following command line:
Data visualization analysis Application of Ffplay-vst 4-ast 5 ~/movies/movie/chinatv-11.tsffplay
- When playing video, experience how XXX decodes each macro block, you can use the command
Ffplay-debug vis_mb_type-window_title "Show Vis_mb_type"-ss 20-t 10-autoexit titanic.ts
Show Window Contents
In the output of the video information, you can see the different colors of the box, below to explain what these colors represent information:
View B-Frame prediction and P-frame prediction information by Ffplay, want to display the information in the window, use the command
FFPLAY-VISMV PF Titanic.ts
Show effect
The information of P-frame motion estimation can be seen through the arrows in the graph.
While the VISMV parameter is used to display the motion vector information when the image is decoded, the parameters can be set to display three types of motion vector information.
This VISMV parameter will be replaced in the future, and in the future more is set using the Codecview filter, as above
Image, or you can do this by following this command
FFPLAY-FLAGS2 +export_mvs TITANIC.TS-VF CODECVIEW=MV=PF+BF+BB
- When playing audio files, not sure whether the sound of the file is normal, noise data and other analysis, you can directly use Ffplay play audio files, playback will be decoded audio data in the audio waveform display:
Ffplay-showmode 1 titanic.ts
Filters (Filter)
In multimedia processing, filter means a software tool that is used to modify the contents of an input file before it is encoded into an output file. For example: Video flip, rotate, zoom and so on.
Syntax: [INPUT_LINK_LABEL1] [Input_link_label1] ... filter_name=parameters [output_link_label1] [Output_link_label2] ...
Filter Diagram Link Label: is the input or output name of the tag filter
- Video Filter-VF
- Rotate the original video clockwise by 90 degrees
Ffplay-i TEST.MP4-VF transpose=1
- Flip the original video vertically
Ffplay-i TEST.MP4-VF Vflip transpose=1
- Overlay the following two effects
Ffplay-i TEST.MP4-VF vflip,transpose=1
- Audio Filter-AF
- Fast playback with 1.5 times times the speed of the original sound
Ffplay-i Test.mp4-af atempo=1.5
Do not complete resources available RTMP links
Hong Kong TV, RTMP://LIVE.HKSTV.HK.LXDNS.COM/LIVE/HKS (recent tests cannot be connected)
Hong Kong Finance, RTMP://202.69.69.180:443/WEBCAST/BSHDLIVE-PC
Korea GOODTV,RTMP://MOBLIESTREAM.C3TV.COM:554/LIVE/GOODTV.SDP
Korea Korea Daily, Rtmp://live.chosun.gscdn.com/live/tvchosun1.stream
United States 1,rtmp://ns8.indexforce.com/home/mystream
United States 2,rtmp://media3.scctv.net/live/scctv_800
American Chinese TV, Rtmp://media3.sinovision.net:1935/live/livestream
Multiple test code streams
http://samples.mplayerhq.hu/
Reference
Https://wenku.baidu.com/view/296eefcaf90f76c661371af1.html
More information, more sharing
Audio and video Technology Exchange Group 1 full
Audio and video Technology Exchange Group 2 full
Audio and video Technology Exchange Group 3 Group No. 782508536
FFmpeg Advanced Series 01-ffplay Command detailed