Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg #2

Open
musapinar opened this issue Apr 17, 2014 · 1 comment
Open

ffmpeg #2

musapinar opened this issue Apr 17, 2014 · 1 comment

Comments

@musapinar
Copy link

Executing ffmpeg with "-vf fps=%s" is an extremely slow and very high cpu consuming process.
I'd suggest the script should require at least 1 more argument: the video's duration in seconds. Then we could do something like:

duration = int(sys.argv[4]) #video duration in seconds
steps = duration/50 # we want 50 tiles for the sprite image (could be passed as an arg as well)
for x in range(1, 51):
    exacttime = steps*(x)
    cmd = "ffmpeg -ss %d -t 1 -i %s -t 1 -y -f mjpeg -vframes 1 -s '640x480' %s/tmp_sprite_tv%%03d.jpg ;" % (exacttime,videofile,newoutdir)

This way we tell ffmpeg exactly when to trigger the screenshots.
Running your script on a 2GB video file took around 15-20min (Celeron 220), running it with the method i suggested takes less than 10sec

Regards,

(sry for my english and the "new issue", i'm new on GitHub)

@vlanard
Copy link
Owner

vlanard commented Sep 3, 2015

The script was written for a video processing workstation with associated resources. It is very fast in this setup. Sounds like you propose a good workaround for slower machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants