Using scripts to eliminate video noise in batches

Source: Internet
Author: User

Preface: Why write such an article? Because I recorded a video, a basic introduction to Python data analysis visualization, and then can't afford to buy a recording device, their computer is not old enough, so in the video with the enduring "buzz ~" sound, then we do? Even if I am not so poor people, I would like to have met, but those who deal with the video software is too big, very easily hundreds of trillion .... My weak computer, do not want to bear these, so Google Bar ~

I have to refer to the following two articles, the first article is almost all ideas, and then the second one is about Ffpmeg parameter explanation.

Although the script is used, but some tools are used, so the first step is to install

Software Required:

Git bash:https://git-scm.com/download/

ffmpeg:https://ffmpeg.zeranoe.com/builds/

sox:https://sourceforge.net/projects/sox/files/sox/


The first is a bash environment under Windows, and as a command line, there can be no command line.

The second one is quite famous.

FFmpeg is an open-source computer program that can be used to record, convert digital audio, video, and turn it into a stream.

The third is used to process audio.

The first, the third basic download installation is OK, and the third one just unzip the line.

Finally, add the Windows environment variable path to the Ffmpeg,sox command.

The simple carcass is that computer----------high-level----system environment variables, locate path--> and then add your own appropriate installation directory.

The effect is as follows: 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7F/0A/wKioL1cQ4KGTrOHGAADThuKSbgY187.png "title=" Image201604151.png "alt=" Wkiol1cq4kgtrohgaadthuksbgy187.png "/>

The main four steps for handling video noise are:

A separate video stream with the audio stream (just a picture without a sound, a no picture only sound.) )

Two-noise sampling (just record a video without a speech is OK?)

Three will separate out the audio to de-noising.

Four to merge the noise-cancelling audio with the previously separated video, it's OK.

How to bulk it? The shell script for a loop is OK? ~ ~ ~


In fact, this script does not exceed 10 lines.

First, the first step, video, audio separation.

#-an represents no audio, it may be the abbreviation of audio no ffmpeg.exe-i source video. Mp4-an output video. MP4#-VN represents no video, it may be the abbreviation ffmpeg.exe-i source video. MP4-VN output audio. wav

Then the second step, the noise sampling (in fact we just have to take it again), simply record a bar of more than one second of the video, only the noise.

#-ss represents the start time,-T represents the time interval, we take one second, and the last filename is the output file name Ffmpeg-i noise video. Mp4-vn-ss 00:00:00-t 00:00:01 separate noise. wav# through Sox We extract the features of the noise, And then you need this. Prof file the noise from the Sox separation. Wav-n noiseprof noise Sample. Prof

The third step is to isolate the audio from the noise

#注意后面的0.21, according to Google to the description, is to say that the value of the best between 0.2 to 2.3, why 0.21 is because of the best effect of others after the test, you can do the corresponding debugging, the value of 0.2 to 0.3 can be Sox output audio. wav audio for denoising. noisered noise Sample. Prof 0.21

A final step. Merging video with noise-cancelling audio

Ffmpeg.exe-i de-noising audio. Wav-i output video. mp4 final video file. mp4

Then we write the script.

Set-xfor i in ' ls *mp4 ';d o f= $i filename=${f%.*} ffmpeg.exe-i $i-an-qscale 0 reduce/$filename. An.mp4; Ffmpeg.exe-i $i-vn reduce/$filename. wav sox.exe reduce/$filename. wav reduce/$filename. Clean.wav noisered  Samplenoise.prof 0.21 ffmpeg.exe-i reduce/$filename. Clean.wav-i reduce/$filename. An.mp4 reduce/$filename. Clean.mp4 Done

First extract the file name, then separate, de-noising, merging, the reason why the noise is not repeated here, because we have to extract it once on the line ~ ~ ~ We will process the files in a unified in the reduce this folder.

Note: The added

-qscale 0 means no compression, that is, the video quality is not compromised, the original painting, haha ~



PostScript: Although in a certain sense, is basically to remove noise, but because of the very rough, so it will be in the video of the vocal part, the human voice will accompany a certain amount of electronic noise, so the complete strategy is to change a computer or buy a recording equipment, haha ~ ~ ~



This article is from the "Ear Note" blog, be sure to keep this source http://youerning.blog.51cto.com/10513771/1764295

Using scripts to eliminate video noise in batches

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.