Quickly cut and merge videos with FFmpeg

Source: Internet
Author: User

If you are directly looking for video cutting and merging of video software, usually comes out of large video editing software or a graphical interface of cutting software, large-scale features too much installation trouble, smaller features may not be complete.

Just a simple cut or a merge, or ffmpeg this command-line tool is the most convenient and fast.

First, cut the video

ffmpeg -i input.mp4 -ss 30 -c copy -to 40 output.mp4

Cut the video from 30 seconds to 40 seconds.

Ffmpeg-i input.wmv-ss 30-c copy-t output.wmv

Second, merged video

1) Merge the original video of YUV type

cat *.yuv > movie.yuv

Converting more YUV frames to one YUV frame-stack Overflow

2) Merge MP4 type video

Save the files that need to be merged to the current directory and make the Input.txt file, and execute the command to begin merging.

Input.txt

file ‘input1.mp4‘file ‘input2.mp4‘file ‘input3.mp4‘
ffmpeg -f concat -i input.txt -codec copy output.mp4

Concat mp4 files with ffmpeg without losing Quality-super User

http://stackoverflow.com/a/11175851

Third, Python play video

Download the vlc.py file and save it to the current directory.

>>> import vlc>>> p = vlc.MediaPlayer("track.mp3")>>> p.play()
>>> p.set_time(12000)
>>> p.get_time()
>>> p.stop()

Audio-playing mp3 song on Python-stack Overflow



 
 
 

Quickly cut and merge videos with FFmpeg

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.