Skip to content

ffmpeg #2

@musapinar

Description

@musapinar

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions