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

How to intercept audio and video by FFmpeg

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

Many beginners are not very clear about how to intercept audio and video in FFmpeg. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.

Today's content let's learn how to use FFmpeg to capture audio and video!

I. preparatory work

First of all, we need to make preparations! We need to determine the directory where we are dealing with the file, and it is best to change the file name to English name, and then we open the command line window through the path bar. These previous courses have been introduced, so we will not repeat them. If you are not proficient in these routines, just review the previous issue! The author still uses the last test file 2_6.mp4 file as the operation object this time!

2. Intercept audio and video

Intercept command:

Ffmpeg-I 2_6.mp4-ss 01:00-t 120 out_2_6.mp4

The command is not very simple, the video below simply demonstrates this process! I believe that you can also successfully intercept the video with this process!

Third, parameter description

However, after the interception is successful, you are likely to be confused. When did I intercept the video and how long did it take? Don't worry, I believe you will suddenly realize after reading the next parameter description!

-I: followed by the input file, the author here is 2_6_all.mp4

-ss: specify the start time. The time format is hour:minute:second. For example, 00:01:00, it means that the video will be intercepted at 00:01:00. If the length of the captured video is less than 1 hour, the first 0 can be omitted.

-t: specify the time to be intercepted from the beginning, and the duration to be intercepted. Here, it is in s (seconds). If specified as 120, it means to intercept 2 minutes.

Output file: specify the name of the output file, author here is out.mp4

In this way, looking back at the author's input parameters, we can see that the work completed by the author is as follows: starting from the 1st minute and 0th second in the 2_6_all.mp4 file, the video is intercepted for 120s (2 minutes), and the intercepted file is named out.mp4! The picture comparison between the original video and the captured video is attached below. I believe it will be more intuitive!

Original video information:

Captured video information:

IV. Expansion

This section demonstrates the interception of MP4 files, but for audio files, or video files that only contain images but not audio, the operation is consistent, as long as the input parameters and output parameters are simply replaced, you can complete the interception function! You can try it!

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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

Internet Technology

Wechat

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

12
Report