6

Audio Processing Using FFMPEG

 2 years ago
source link: https://jdhao.github.io/2021/11/10/ffmpeg_audio_processing/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Audio Processing Using FFMPEG

2021-11-10155 words 1 min read 18 times read

Collected tips on audio processing with ffmpeg.

Remove audio from a video

To remove audio from a video file, i.e., muting the video, run the following command:

ffmpeg -i input.mp4 -c copy -an input-silent.mp4

Extract audio from ffmpeg

ffmpeg -i input.mp4 -vn -acodec copy out.acc
  • -vn: do not use video
  • -acodec copy: copy the audio stream (equivalent to -codec:a copy, see stream specifier)

Extract audio in a time range

ffmpeg -i input.mp4 -vn -acodec copy -ss 00:01:00 -t 30 out.aac
  • -ss: the start time to process the video, in above case, we start from 1 minute
  • -t: the video duration to process, in this case, we process 30 seconds of video.

There is also a -to option which specifies the stop time to process the video. So the above command can also be written as:

ffmpeg -i input.mp4 -vn -acodec copy -ss 00:01:00 -to 00:01:30 out.aac

Author jdhao

LastMod 2021-11-10

License CC BY-NC-ND 4.0

Reward
PyAV for video processing

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK