use stream copy mode (no re-encoding)
- Note: watch out when using -ss with -c copy if the source is encoded with an interframe codec (e.g., H.264). Since ffmpeg must split on i-frames, it will seek to the nearest i-frame to begin the stream copy.
+ Note: watch out when using -ss with -c copy if the source is encoded with an interframe codec (e.g., H.264). Since ffmpeg must split on i-frames, it will seek to the nearest i-frame to begin the stream copy.
output_file
path, name and extension of the output file
-
-
Variation: trim video by setting duration, by using -t instead of -to
Beginning five minutes into the original video, this command will create a 10-second-long excerpt.
+
@@ -728,14 +728,14 @@
ffplay -framerate 5 input_file_%06d.ext
ffplay
starts the command
-
-framerate 5
plays image sequence at rate of 5 images per second
- Note: this low framerate will produce a slideshow effect.
+
-framerate 5
plays image sequence at rate of 5 images per second
+ Note: this low framerate will produce a slideshow effect.
-i input_file
path, name and extension of the input file
This must match the naming convention used! The regex %06d matches six-digit-long numbers, possibly with leading zeroes. This allows the full sequence to be read in ascending order, one image after the other.
- The extension for TIFF files is .tif or maybe .tiff; the extension for DPX files is .dpx (or even .cin for old files). Screenshots are often in .png format.
+ The extension for TIFF files is .tif or maybe .tiff; the extension for DPX files is .dpx (or even .cin for old files). Screenshots are often in .png format.
-
Notes:
-
If -framerate is omitted, the playback speed depends on the image’s file size and on the computer's processing power. It may be rather slow for large image files.
+
Notes:
+
If -framerate is omitted, the playback speed depends on the images’ file sizes and on the computer’s processing power. It may be rather slow for large image files.
You can navigate durationally by clicking within the playback window. Clicking towards the left-hand side of the playback window takes you towards the beginning of the playback sequence; clicking towards the right takes you towards the end of the sequence.
This command combines two audio tracks present in a video file into one stream. It can be useful in situations where a downstream process, like YouTube’s automatic captioning, expect one audio track. To ensure that you’re mapping the right audio tracks run ffprobe before writing the script to identify which tracks are desired. More than two audio streams can be combined by extending the pattern present in the -filter_complex option.
This command will take an image file (e.g. image.jpg) and an audio file (e.g. audio.mp3) and combine them into a video file that contains the audio track with the image used as the video. It can be useful in a situation where you might want to upload an audio file to a platform like YouTube. You may want to adjust the scaling with -vf to suit your needs.
-
ffmpeg
-
starts the command
-
-r 1
-
set the framerate
-
-loop 1
-
loop the first input stream
-
-i image_file
-
path, name and extension of the image file
-
-i audio_file
-
path, name and extension of the audio file
-
-acodec copy
-
copy the audio. -acodec is an alias for -c:a
-
-shortest
-
finish encoding when the shortest input stream ends
-
-vf scale=1280:720
-
filter the video to scale it to 1280x720 for YouTube. -vf is an alias for -filter:v
-
video_output_file
-
path, name and extension of the video output file
+
ffmpeg
starts the command
+
-r 1
set the framerate
+
-loop 1
loop the first input stream
+
-i image_file
path, name and extension of the image file
+
-i audio_file
path, name and extension of the audio file
+
-acodec copy
copy the audio. -acodec is an alias for -c:a
+
-shortest
finish encoding when the shortest input stream ends
+
-vf scale=1280:720
filter the video to scale it to 1280x720 for YouTube. -vf is an alias for -filter:v