ffmpeg command to take screenshots of video files (and command explanation)

Example: ffmpeg -y -i "cuplayer.avi" -title "Test" -vcodec xvid -s 368x208 -r 29.97 -b 1500 -acodec aac -ac 2 -ar 24000 -ab 128 -vol 200 -f psp -muxvb 768

Explanation of "output.wmv" : The above commands can be entered in the Dos command line, or they can be created and run in a batch file. However, the premise is: to execute in the directory where ffmpeg is located (the cores subdirectory under the directory where the conversion is located).
parameter:

 

-Y Overwrite the output file, that is, if the output.wmv file already exists, it will be overwritten without prompting
-i "1.avi" The input file is 1.avi file in the same directory as ffmpeg, you can add the path and change the name
-title "Test" The title of the movie displayed in the PSP
-vcodec xvid Use XVID encoding to compress the video, which cannot be changed
-s 368x208 The output resolution is 368x208. Note that the source must be 16:9 or it will be deformed
-r 29.97 Frame number, generally use this
-b 1500 For video data flow, use the -b xxxx command to use a fixed bit rate, and change the number at will, no effect above 1500; you can also use a dynamic bit rate such as: -qscale 4 and -qscale 6, the quality of 4 is higher than that of 6.
-acodec aac AAC for audio coding
-ac 2 Number of channels 1 or 2
-or 24000 The sampling frequency of the sound, it seems that PSP can only support 24000Hz
-from 128 Audio data flow, generally select 32, 64, 96, 128
-vol 200 200% volume, change it yourself
-muxvb 768 It seems to be the code rate recognized by the PSP machine. Generally, 384, 512 and 768 are selected. I changed it to 1500, and the PSP said the file is damaged.
-f psp Output psp special format
"output.wmv" Output file name, you can also add path to change file name

Example 1:
Take a picture of 352x240 size in jpg format: 
ffmpeg -i test.asf -y -f image2 -t 0.001 -s 352x240 a.jpg

Example 2:
Convert the first 30 frames of the video into an Animated Gif: 
ffmpeg -i test.asf -vframes 30 -y -f gif a.gif

Example 3: Take a screenshot of a
352*240 thumbnail at the 8.01 second of the video
ffmpeg -i test2.asf -y -f image2 -ss 08.010 -t 0.001 -s 352x240 b.jpg

Example: ffmpeg -y -i "cuplayer.avi" -title "Test" -vcodec xvid -s 368x208 -r 29.97 -b 1500 -acodec aac -ac 2 -ar 24000 -ab 128 -vol 200 -f psp -muxvb 768

Explanation of "output.wmv" : The above commands can be entered in the Dos command line, or they can be created and run in a batch file. However, the premise is: to execute in the directory where ffmpeg is located (the cores subdirectory under the directory where the conversion is located).
parameter:

 

-Y Overwrite the output file, that is, if the output.wmv file already exists, it will be overwritten without prompting
-i "1.avi" The input file is 1.avi file in the same directory as ffmpeg, you can add the path and change the name
-title "Test" The title of the movie displayed in the PSP
-vcodec xvid Use XVID encoding to compress the video, which cannot be changed
-s 368x208 The output resolution is 368x208. Note that the source must be 16:9 or it will be deformed
-r 29.97 Frame number, generally use this
-b 1500 For video data flow, use the -b xxxx command to use a fixed bit rate, and change the number at will, no effect above 1500; you can also use a dynamic bit rate such as: -qscale 4 and -qscale 6, the quality of 4 is higher than that of 6.
-acodec aac AAC for audio coding
-ac 2 Number of channels 1 or 2
-or 24000 The sampling frequency of the sound, it seems that PSP can only support 24000Hz
-from 128 Audio data flow, generally select 32, 64, 96, 128
-vol 200 200% volume, change it yourself
-muxvb 768 It seems to be the code rate recognized by the PSP machine. Generally, 384, 512 and 768 are selected. I changed it to 1500, and the PSP said the file is damaged.
-f psp Output psp special format
"output.wmv" Output file name, you can also add path to change file name

Example 1:
Take a picture of 352x240 size in jpg format: 
ffmpeg -i test.asf -y -f image2 -t 0.001 -s 352x240 a.jpg

Example 2:
Convert the first 30 frames of the video into an Animated Gif: 
ffmpeg -i test.asf -vframes 30 -y -f gif a.gif

Example 3: Take a screenshot of a
352*240 thumbnail at the 8.01 second of the video
ffmpeg -i test2.asf -y -f image2 -ss 08.010 -t 0.001 -s 352x240 b.jpg

Guess you like

Origin blog.csdn.net/hwx802746/article/details/111578404