« Playing with ffplay
Playing with ffplay
1ffplay bullfinch.mp4
1ffplay -v error bullfinch.mp4
-v error
is to suppress some unnecessary logs. Running either of the above commands will play the video.- It plays the video in a window that is as big as the original size of the video.
1ffplay -v error bullfinch.mp4 -x 600 -y 600
Above command will play the video in a smaller window size as dimensions are mentioned in the command.
1ffplay -v error bullfinch.mp4 -x 600 -y 600 -noborder
Above command will remove the border from the window. You can see that it automatically fills the extra space between the video area and the window area with a black region, because the aspect ratio of the window and the video is different.
1ffplay -v error bullfinch.mp4 -y 600 -noborder
- You can actually specify just one of either width or height, and it will calculate the other as per aspect ratio so that we don't see this black pattern region.
- If we take away the width from the window, you see that this time there are no black padding regions and the width is calculated to preserve aspect ratio.
1ffplay -v error bullfinch.mp4 -y 600 -noborder -top 0 -left 0
You can see that the window is placed in the center of the screen by default. So if you want to change this, you can do so with the top and left options.
1ffplay -v error bullfinch.mp4 -y 600 -noborder -fs
You can play the video full screen if you want, by just adding the -fs
option for full screen.
1ffplay -v error bullfinch.mp4 -y 600 -noborder -an
You can also disable the audio while playing with the -an
option.
1ffplay -v error bullfinch.mp4 -y 600 -noborder -vn
You can also disable the video while playing with the -vn
option. So if disable the video playback in that case, ffplay automatically shows a default visualization for the audio using RDFT
.
1ffplay -v error bullfinch.mp4 -y 600 -noborder -showmode waves
So this mode of playback can also be chosen with showmode. If you want to see the audio waves, you just add -showmode waves
.
1ffplay -v error bullfinch.mp4 -y 600 -noborder -loop 0
If you want to keep the keep playing the video in a loop, you just add -loop
and the number of times you want to loop and 0 for if you want to play it forever.
Some shortcuts you can use while the video is playing.
spacebar
: you can press thespacebar
to pause and resume playback like this.m
: You can pressm
for muting and unmuting while it is playing.f
: You can pressf
to toggle full screen.left mouse click
: toggle full screen9
&0
: You can use the9
and0
keys to decrease and increase the audio volume.w
: You can pressw
to cycle through the show modes.s
: It is often useful to step through the frames one by one, you can use thes
to do that.left and right arrows
: The left and right arrows can be used to seek backward and forward 10 seconds at a time.down and up arrows
: You can jump faster with the down and up arrows, which will jump one minute backward or forward.esc
: To quit ffplay.
Playing audio
1ffplay -v error birds-forest.ogg -showmode waves
Besides playing video, we can use ffplay to play audio files as well.
Showing images
1ffplay -v error kingfisher.jpg
I can also ffplay to view images.
Playing media directly from the web
1ffplay -v error https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_1MB.mp4
I can also play in media directly from the Web if you provide an http link.