LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How can I trim silent portions of a video automatically? (https://www.linuxquestions.org/questions/linux-software-2/how-can-i-trim-silent-portions-of-a-video-automatically-4175500577/)

gustywind 04-04-2014 09:34 AM

How can I trim silent portions of a video automatically?
 
I am trying to find a way to automatically remove silent portions of a video.

My current (manual) solution is to extract the audio track to a separate mp3 file using mencoder, detect the silent portions of the mp3 file with mp3splt, then use the information that I get from the mp3splt output as a guide as I manually edit the video file with avidemux.

This takes a while.

I have tried to write a script to use the avidemux command line interface to do the video editing; but (for reasons that I have not been able to solve) this invariably causes audio sync problems that I don't see when I use the gui interface to avidemux.

I don't really care if the solution is a command line script or a gui program that has some sort of silence detection filter.

Does anyone have a linux solution for this problem?

schneidz 04-04-2014 09:57 AM

mencoder has -ss and -endpos options:
http://www.misterhowto.com/?category..._with_mencoder

gustywind 04-04-2014 06:53 PM

Thanks for your reply. I knew about those mencoder options; but somehow misinterpreted them as useful only for excising leading or trailing periods of silence.

I have modified my script to use mencoder with these options to see how it works. It will take a while to test the resulting output; but I will post my result once I finish testing.

gustywind 04-14-2014 06:41 PM

I have worked with the mencoder options and I have a solution that works, although not as well as I would like.

It seems that the -ss and -endpos options are not particularly time accurate as to where the cut occurs. I am seeing as much as a 10 second discrepancy between the requested cut point and the actual cut point.

Other than that, this is a solution that works for me and I can live with this amount of inaccuracy; but if anyone has a solution for this problem I would like to hear about it.

schneidz 04-14-2014 06:45 PM

seems like the indexing on the original input avi is set to 10 seconds. i think there is a way to increase it.


All times are GMT -5. The time now is 11:33 AM.