FFmpeg Common basic Commands (RPM)

Source: Internet
Author: User

FFmpeg Common basic Commands (RPM)

"FFmpeg" FFmpeg common basic commands

1. Separating the video audio stream

Ffmpeg-i input_file-vcodec Copy-an output_file_video//split video stream ffmpeg-i Input_file-acodec copy-vn output_file_audio/ /Separate audio streams

2. Video re-use

Ffmpeg–i test.mp4–vcodec copy–an–f m4v test.264ffmpeg–i test.avi–vcodec copy–an–f m4v test.264

3. Video transcoding

Ffmpeg–i test.mp4–vcodec h264–s 352*278–an–f m4v test.264//transcoding to bitstream original file Ffmpeg–i Test.mp4–vcodec H264–BF            0–g 25–s 352*278–an–f m4v test.264//Transcode to stream original file Ffmpeg–i test.avi-vcodec mpeg4–vtag xvid–qsame Test_xvid.avi transcoding to package file//-BF B frame number control,-g key frame interval control,-s resolution control

4. Video Encapsulation

Ffmpeg–i video_file–i audio_file–vcodec copy–acodec copy output_file

5. Video Clipping

Ffmpeg–i test.avi–r 1–f image2 image-%3d.jpeg//Extract picture Ffmpeg-ss 0:1:30-t 0:0:20-i input.avi-vcodec Copy-acode C copy Output.avi//Cut video//-r Extract the frequency of the image,-ss start time,-t duration

6. Video recording

Ffmpeg–i Rtsp://192.168.3.205:5555/test–vcodec Copy Out.avi

7.YUV sequence Playback

Ffplay-f rawvideo-video_size 1920x1080 INPUT.YUV

8.YUV sequence turn avi

Ffmpeg–s w*h–pix_fmt yuv420p–i input.yuv–vcodec MPEG4 Output.avi

Common parameter Description:

main parameters: -I set input stream-F Set output format-ss start time video parameter: -B Set video traffic, default to 200KBIT/S-R set frame rate, default to 25-s setting screen width and height-aspect setting screen ratio Example-VN does not process video-vcodec set video codec, without timing the same codec audio parameters as the input stream:-ar Set Sample rate-ac set the channel number of sound-acodec set sound codec, not set timing is the same as the input stream Codec-an does not process audio

------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------

1. Send files to live as Live

Ffmpeg-re-i localfile.mp4-c copy-f flv rtmp://server/live/streamname

2. Save the live media to a local file

Ffmpeg-i rtmp://server/live/streamname-c Copy dump.flv

3, one of the live stream, video instead of H264 compression, audio unchanged, sent to another live streaming service

Ffmpeg-i rtmp://server/live/originalstream-c:a copy-c:v libx264-vpre slow-f flv rtmp://server/live/h264stream

4, one of the live stream, video instead of H264 compression, audio instead of FAAC compression, sent to another live streaming service

Ffmpeg-i rtmp://server/live/originalstream-c:a libfaac-ar 44100-ab 48k-c:v libx264-vpre slow-vpre baseline-f flv r Tmp://server/live/h264stream

5, one of the live stream, the video is unchanged, the audio instead of FAAC compression, sent to another live streaming service

Ffmpeg-i rtmp://server/live/originalstream-acodec libfaac-ar 44100-ab 48k-vcodec copy-f flv rtmp://server/live/h264_ Aac_stream

6, will a high stream, copied to several different video definition of the flow re-release, where the audio does not change

ffmpeg -re -i rtmp://server/live/high_fmle_stream -acodec copy  -vcodec x264lib -s 640x360 -b 500k -vpre medium -vpre  baseline rtmp://server/live/baseline_500k -acodec copy -vcodec x264lib -s  480x272 -b 300k -vpre medium -vpre baseline rtmp://server/live/baseline_ 300k -acodec copy -vcodec x264lib -s 320x200 -b 150k -vpre  medium -vpre baseline rtmp://server/live/baseline_150k -acodec libfaac -vn  -ab 48k rtmp://server/live/audio_only_aac_48k 

< Span style= "color: #444444; line-height:22.39px; Font-family:verdanna,helvetica,arial,sans-serif; font-size:14px; " >

ffmpeg -re -i rtmp://server/live/high_fmle_stream -c:a copy - c:v x264lib -s 640x360 -x264opts bitrate=500:profile=baseline:preset=slow rtmp:/ /server/live/baseline_500k -c:a copy -c:v x264lib -s 480x272 -x264opts  bitrate=300:profile=baseline:preset=slow rtmp://server/live/baseline_300k -c:a copy  -c:v x264lib -s 320x200 -x264opts bitrate=150:profile=baseline:preset=slow rtmp ://server/live/baseline_150k -c:a libfaac -vn -b:a 48k rtmp://server/live/audio_ only_aac_48k 

< Span style= "color: #444444; line-height:22.39px; Font-family:verdanna,helvetica,arial,sans-serif; font-size:14px; " >< Span style= "color: #444444; line-height:22.39px; Font-family:verdanna,helvetica,arial,sans-serif; font-size:14px; " >8, the current camera and audio through Dsshow capture , video h264, audio FAAC compressed post

ffmpeg -r 25 -f dshow -s 640x480 -i video= "video  source name ": audio=" Audio source name " -vcodec libx264 -b 600k - vpre slow -acodec libfaac -ab 128k -f flv rtmp://server/application/ Stream_name 

< Span style= "color: #444444; line-height:22.39px; Font-family:verdanna,helvetica,arial,sans-serif; font-size:14px; " > picture after H264 compression loop output to MP4 video

ffmpeg.exe -i input.jpg -an -vcodec libx264 -coder 1  -flags +loop -cmp +chroma -subq 10 -qcomp 0.6 -qmin 10  -qmax 51 -qdiff 4 -flags2 +dct8x8 -trellis 2 -partitions + parti8x8+parti4x4 -crf 24 -threads 0 -r 25 -g 25 -y  Output.mp4 

< Span style= "color: #444444; line-height:22.39px; Font-family:verdanna,helvetica,arial,sans-serif; font-size:14px; " >

Ffmpeg-i rtmp://server/live/originalstream-c:a copy-c:v libx264-vpre slow-f flv "Rtmp://server/live/h264stream live=1 〃

------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------

1. Capture USB camera video commands:

Ffmpeg-t 20-f vfwcap-i 0-r 8-f mp4 cap1111.mp4

./ffmpeg-t 10-f vfwcap-i 0-r 8-f mp4 cap.mp4

The specific description is as follows: We collect 10 seconds, the acquisition device for the VFWCAP type equipment, the NO. 0 vfwcap acquisition Equipment (if the system has a number of VFW video capture equipment, can be selected through-I num), 8 frames per second, the output mode is a file, the format of MP4.

2. The simplest screen capture:

Ffmpeg-f gdigrab-i Desktop Out.mpg

3. Starting at the (10,20) point of the screen, grab the 640x480 screen and set the frame rate at 5:

Ffmpeg-f gdigrab-framerate 5-offset_x 10-offset_y 20-video_size 640x480-i Desktop Out.mpg

4.ffmpeg creating a GIF image from your video:

Ffmpeg-i capx.mp4-t 10-s 320x240-pix_fmt rgb24 jidu1.gif

5.ffmpeg convert a picture to a video:

Http://blog.sina.com.cn/s/blog_40d73279010113c2.html


FFmpeg Common basic Commands (RPM)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.