LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2017, 11:20 PM   #1
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Rep: Reputation: 30
trimming multiple videos


I have around 200 videos in a folder and I am trying to trim the first 10 seconds and last 5 seconds from them, is there a way that I can do this in bash rather than editing each video individually!?

I was thinking that I could create a loop and put something like this:

Code:
for i in *
do
  $len = (not sure how to get video length) - 5 
   avconv -i "$i" -ss 00:00:10 -t $ -codec copy "new_$i"
done
I'm not quite sure how to get the video length though or if this method would even work :/

Cheers
 
Old 05-09-2017, 01:48 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,401
Blog Entries: 10

Rep: Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213
i'm sure avconv (shouldn't you be using ffmpeg instead?) has an option to get the length of the video.
https://duckduckgo.com/?q=ffmpeg+get+length+of+video
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Downloading Multiple Videos using FOR Loop metallica1973 Linux - Software 3 02-04-2013 03:03 PM
X11, xv and opengl errors when playing multiple videos RVF16 Linux - General 3 02-06-2009 03:16 PM
multiple (equidistant) thumbnails for videos philippeP Linux - Software 3 07-10-2008 04:33 PM
Is it possible to play MULTIPLE Videos using Xine ?? dezireduser Linux - Software 2 01-08-2006 09:11 PM
Multiple CUPS problems (trimming pages, wrong pagesize) rutgerw Linux - Software 3 09-05-2005 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration