I have pack of .avi files that needs to be trimmed by 5 last seconds. I'm doing it using batch processing and naturally, they all have different length so I can't set a trim from the beginning.
I know FFMpeg has commands -t and -ss as well as Mencoder has -endpos and -ss, but in my case I don't know if I can use them this way. My .bat file will look like this
FOR %%i IN (*.avi) DO (
ffmpeg/mencoder -options "%%i" "%%~ni"1.avi )
Thanks in advance.
		
			+ Reply to Thread
			
		
		
		
			
	
	
				Results 1 to 3 of 3
			
		- 
	
- 
	Hi 
 You need to find the duration of each file then subtract 5 seconds and use the result with "-t" or "-endpos" with FFmpeg or MEncoder.
 
 
 shows (for example):-Code:ffprobe "filename" 
 With mplayer it's a bit more complicated...Duration: 00:01:02.08
 shows (for example):-Code:mplayer -vo null -ao null -frames 0 -identify "filename" 2>/dev/null | sed -ne '/^ID_/ {s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p}'
 Also mediainfo:-ID_LENGTH=62.08
 shows (for example):-Code:mediainfo "filename" 
 So your .bat file could include a routine to calculate the result and assign it to a variable to be used with "-t" or "-endpos" in the FFmpeg or MEncoder command.Duration : 1mn 0sLast edited by bat999; 2nd Sep 2012 at 13:42. 
- 
	Ok, but how the final script should look like? 
 I don't understand how it should be done.
Similar Threads
- 
  Trimming AVI in virtualdub,direct strem copy ignores my start and end pointBy Rudyard in forum EditingReplies: 4Last Post: 4th Oct 2010, 20:11
- 
  Mencoder // ffmpeg flv file Audio-video sync problemBy krishnareddy in forum ffmpegX general discussionReplies: 5Last Post: 26th Apr 2009, 10:13
- 
  Video Capture with Mplayer, Mencoder or ffmpeg under Winxp. Is it possible?By gll99 in forum Capturing and VCRReplies: 0Last Post: 11th Sep 2008, 19:00
- 
  QT movie with 2 video tracks to FLV with mencoder or ffmpegBy bluehz in forum Video ConversionReplies: 0Last Post: 26th Mar 2008, 16:39
- 
  How to add watermark to a video with mencoder or how to scale with FFmpeg?By ApplePro in forum Video ConversionReplies: 16Last Post: 21st Nov 2007, 10:12


 
		
		 View Profile
				View Profile
			 View Forum Posts
				View Forum Posts
			 Private Message
				Private Message
			 
 
			
			 
			
 Quote
 Quote 
			
