FFmpeg is a powerful command-line tool for working with multimedia files, including video editing and manipulation. It offers a wide range of commands and options for editing videos. Here are some useful FFmpeg commands for video editing:
Convert Video Formats:
bashffmpeg -i input.mp4 output.avi
Change Video Resolution:
bashffmpeg -i input.mp4 -vf scale=1280:720 output.mp4
Trim/Cut Video:
bashffmpeg -i input.mp4 -ss 00:00:10 -t 00:00:30 -c copy output.mp4
Concatenate/Join Videos:
bashffmpeg -f concat -i filelist.txt -c copy output.mp4
Add Watermark:
bashffmpeg -i input.mp4 -i watermark.png -filter_complex "overlay=10:10" output.mp4
Change Video Speed:
bashffmpeg -i input.mp4 -vf "setpts=0.5*PTS" output.mp4
Extract Audio:
bashffmpeg -i input.mp4 -vn -acodec copy output.mp3
Merge Video and Audio:
bashffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -strict experimental output.mp4
Rotate Video:
bashffmpeg -i input.mp4 -vf "transpose=1" output.mp4
Add Subtitles:
bashffmpeg -i input.mp4 -vf "subtitles=sub.srt" output.mp4
Resize Video Aspect Ratio:
bashffmpeg -i input.mp4 -vf "scale=640:480:force_original_aspect_ratio=decrease" output.mp4
Change Video Bitrate:
bashffmpeg -i input.mp4 -b:v 1000k output.mp4
These are just some of the many video editing tasks you can perform using FFmpeg. Make sure to replace input.mp4, output.mp4, and other parameters with your actual file names and settings. FFmpeg's flexibility allows for extensive video editing and manipulation, but the commands can be complex, so be sure to consult the FFmpeg documentation for more details and advanced options.
Extract Frames as Images:
bashffmpeg -i input.mp4 -vf "select='gte(n\,10)',setpts=N/TB" frame%d.png
Create a Video Slideshow:
bashffmpeg -framerate 24 -i image%d.jpg -c:v libx264 -r 30 output.mp4
Add Audio to a Video:
bashffmpeg -i video.mp4 -i audio.mp3 -map 0 -map 1 -c:v copy -c:a aac -strict experimental output.mp4
Remove Audio from a Video:
bashffmpeg -i input.mp4 -an output.mp4
Change Video Codec:
bashffmpeg -i input.mp4 -c:v h264 -c:a aac output.mp4
Extract a Portion of Video as GIF:
bashffmpeg -ss 00:00:10 -t 5 -i input.mp4 -vf "fps=10,scale=320:-1" output.gif
Adjust Video Brightness, Contrast, and Saturation:
bashffmpeg -i input.mp4 -vf "eq=brightness=1.2:contrast=1.5:saturation=1.2" output.mp4
Extract a Specific Audio Channel:
bashffmpeg -i input.mp4 -map_channel 0.0.0 left.wav
Apply Video Filters:
bashffmpeg -i input.mp4 -vf "boxblur=5:1" output.mp4
Speed Up/Slow Down Video with Audio Pitch Preservation:
bashffmpeg -i input.mp4 -vf "setpts=0.5*PTS" -filter:a "atempo=2.0" output.mp4
Split Video into Equal Parts:
bashffmpeg -i input.mp4 -c copy -map 0 -segment_time 00:05:00 -f segment output%d.mp4
Remember that FFmpeg offers an extensive set of commands and options for video editing and manipulation.
Overlay Multiple Videos:
bashffmpeg -i video1.mp4 -i video2.mp4 -filter_complex "[0:v][1:v]overlay=W-w-10:H-h-10[out]" -map "[out]" output.mp4
Change Video Playback Speed with Audio Pitch Correction:
bashffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4
Remove a Specific Audio Stream:
bashffmpeg -i input.mp4 -map 0 -map -0:a:1 output.mp4Reverse a Video:
- Reverse the frames of a video to play it backward.
bashffmpeg -i input.mp4 -vf reverse output.mp4
Add a Border or Padding:
- Add a border or padding to a video to change its aspect ratio or size.
bashffmpeg -i input.mp4 -vf "pad=width:height:x:y:color" output.mp4
Change Video Aspect Ratio:
- Modify the aspect ratio of a video by cropping or padding.
bashffmpeg -i input.mp4 -vf "crop=640:480" output.mp4
Extract Audio from a Video with Specific Codec:
- Extract audio from a video and specify the audio codec.
bashffmpeg -i input.mp4 -vn -acodec pcm_s16le output.wav
Adjust Audio Volume:
- Change the volume of an audio stream in a video.
bashffmpeg -i input.mp4 -af "volume=1.5" -c:v copy output.mp4
Remove Subtitles:
- Remove subtitles or captions from a video.
bashffmpeg -i input.mp4 -scodec mov_text -an output.mp4
Extract Metadata:
- Extract and display metadata information from a video.
bashffmpeg -i input.mp4 -f ffmetadata metadata.txt
Change Frame Rate:
- Modify the frame rate of a video.
bashffmpeg -i input.mp4 -r 30 output.mp4
Sorry, we detected that you have activated Ad-Blocker.
Please consider supporting us by disabling your Ad-Blocker, it helps us in developing this Website.
Thank you!