Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common commands of ffmpeg in Linux

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the common ffmpeg commands in Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what ffmpeg commands are commonly used in Linux.

FFmpeg is an open source computer program that can be used to record, convert digital audio and video, and convert it into a stream. Use the LGPL or GPL license. It provides a complete solution for recording, converting and streaming audio and video. It contains a very advanced audio / video codec library libavcodec. In order to ensure high portability and codec quality, many code in libavcodec are developed from scratch.

Ffmpeg uses the syntax ffmpeg [[options] [`- i' input_file]]... {[options] output_file}...

If there is no input file, then video and audio capture (valid only under Linux, because audio and video devices are treated as file handles under Linux) will work. As a general rule, option one applies to the next specific file. If you give the-b 64 option, the change will set the next video rate. For the original input file, formatting options may be required. By default, ffmpeg tries to convert as lossless as possible, using the same audio and video parameters as the input.

There are many options involved in ffmpeg conversion, which can be explained by referring to the ffmpeg option.

Ffmpeg supports multiple file formats and audio and video encoders. Please refer to ffmepg format for detailed explanation (attached: detailed explanation of common video file formats)

Screenshot of video file

Capture a 352x240size picture in jpg format

Ffmpeg-I test.asf-y-f image2-t 0.001-s 352x240 a.jpg

Convert the first 30 frames of the video into an Animated Gif

Ffmpeg-I test.asf-vframes 30-y-f gif a.gif

Capture a thumbnail of a specified time

Ffmpeg-I test.avi-y-f image2-ss 8-t 0.001-s 350x240 test.jpg

Convert files to 3GP format

Ffmpeg-y-I test.mpeg-bitexact-vcodec h363-b 128-r 15-s 176x144-acodec aac-ac 2-ar 22500-ab 24-f 3gp test.3gpffmpeg-y-I test.wmv-ac 1-acodec libamr_nb-ar 8000-ab 12200-s 176x144-b 128-r 15 test.3gp video format conversion

How to use ffmpeg coding to get high quality video

Ffmpeg.exe-I "D:\ Video\ Fearless\ Fearless.avi"-target film-dvd-s 720x352-padtop 64-padbottom 64-maxrate 7350000-b 3700000-sc_threshold 1000000000-trellis-cgop-g 12-bf 2-qblur 0.3-qcomp 0.7-me full-dc 10-mbd 2-aspect 16:9-pass 2-passlogfile "D:\ Video\ ffmpegencode"-an-f mpeg2video "D:\ Fearless.m2v"

Convert the specified format file to FLV format

Ffmpeg.exe-I test.mp3-ab 56-ar 22050-b 500-r 15-s 320x240 f:\ test.flvffmpeg.exe-I test.wmv-ab 56-ar 22050-b 500-r 15-s 320x240 f:\ test.flv

Transcoded decrypted VOB

Ffmpeg-I snatch_1.vob-f avi-vcodec mpeg4-b 800-g 300-bf 2-acodec mp3-ab 128 snatch.avi

Simultaneously encode to several formats and establish a mapping between the input stream and the output stream

Ffmpeg-I / tmp/a.wav-ab 64 / tmp/a.mp2-ab 128 / tmp/b.mp2-map 0:0-map 0:0

Convert files to 3GP format

Ffmpeg-I test.avi-y-b 20-s sqcif-r 10-acodec amr_wb-ab 23.85-ac 1-ar 16000 test.3gp

Convert files to MP4 format (iPhone/iTouch is supported)

Ffmpeg-y-I input.wmv-f mp4-async 1 murs 480x320-acodec libfaac-vcodec libxvid-qscale 7-dts_delta_threshold 1 output.mp4ffmpeg-y-I source_video.avi input-acodec libfaac-ab 128000-vcodec mpeg4-b 1200000-mbd 2-flags + 4mv+trell-aic 2-cmp 2-subcmp 2-s 320x180-title X final_video.mp4

Mix an audio with a video

Ffmpeg-I son.wav-I video_origine.avi video_finale.mpg

Convert a video to DVD format

Ffmpeg-I source_video.avi-target pal-dvd-ps 2000000000-aspect 16:9 finale_video.mpeg

Convert a video to DivX format

Ffmpeg-I video_origine.avi-s 320x240-vcodec msmpeg4v2 video_finale.avi

Turn X images to a video sequence

Ffmpeg-f image2-I image%d.jpg video.mpg

Turn a video to X images

Ffmpeg-I video.mpg image%d.jpg screen recording

Use the ffmpeg video screen

Ffmpeg-vcodec mpeg4-b 1000-r 10-g 300-vd x11 vd 0-s 1024x768 ~ / test.avi

: among them,-vd x11ghuzhao 0 refers to the offset used for recording is xan0 and yqun0fujimi 1024 × 768 refers to the size of the recorded video is 1024 × 768. The recorded video file is test.avi and will be saved to the user's home directory

Resize the video

Ffmpeg-vcodec mpeg4-b 1000-r 10-g 300-I ~ / test.avi-s 800 × 600 ~ / test-800-600.avi video capture

Record the real-time video of the camera and save it as a file

Ffmpeg-f video4linux-s 320mm 240-r 10-I / dev/video0 test.asf

Use ffmpeg to suppress H.264 video

Ffmpeg-threads 4-I INPUT-r 29.97-vcodec libx264-s 480x272-flags + loop-cmp + chroma-deblockalpha 0-deblockbeta 0-crf 24-bt 256k-refs 1-coder 0-me umh-me_range 16-subq 5-partitions + parti4x4+parti8x8+partp8x8-g 250-keyint_min 25-level 30-qmin 10-qmax 51-trellis 2-sc_threshold 40-i_qfactor 0.71-acodec libfaac-ab 128k-ar 48000-ac 2 OUTPUT so far, I believe you have a better understanding of "ffmpeg commands commonly used in Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report