Thread: Tech FFmpeg duration
View Single Post
Old 10-27-2017, 01:05 AM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
I found this It maybe could be adapted
the purpose was to extract a thumbnail from the middle
but it does find the middle an do something

your problem is that you want to do this in a single pass

the thread> https://superuser.com/questions/4773...eo-with-ffmpeg

Quote:
up vote
-1
down vote


This bash command works like a charm:

Code:
avconv -i 'in.mpg' -vcodec mjpeg -vframes 1 -an -f rawvideo \
-s 420x300 -ss `avconv -i in.mpg 2>&1 | grep Duration \
| awk '{print $2}' | tr -d , \ 
| awk -F ':' '{print ($3+$2*60+$1*3600)/2}'` out.jpg
shareimprove this answer

edited May 15 '15 at 7:40
Matt Joiner
463725

answered Nov 9 '14 at 17:14
Георги Стефанов
1



My god that's complicated ? Sridhar-Sarnobat Mar 18 '15 at 18:22
Last post -- well life ain't simple dude
awk -F ':' '{print ($3+$2*60+$1*3600)/2 gets your midpoint
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote