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

mp4 ending at ($duration % $interval == 0) causing issues. (Quick fix provided) #75

Open
GuguKatze opened this issue Mar 29, 2020 · 3 comments
Labels

Comments

@GuguKatze
Copy link

I love your tool and I am using it to generate previews for thousands of videos. Everything works perfectly and the videos are all from streamlink and the same source (twitch) but like ever 100th or so gives me an error like this:

Traceback (most recent call last):
File "/usr/local/bin/vcsi", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/vcsi/init.py", line 3, in main
vcsi.vcsi.main()
File "/usr/local/lib/python3.6/dist-packages/vcsi/vcsi.py", line 1518, in main
process_file(filename, args)
File "/usr/local/lib/python3.6/dist-packages/vcsi/vcsi.py", line 1646, in process_file
selected_frames, temp_frames = select_sharpest_images(media_info, media_capture, args)
File "/usr/local/lib/python3.6/dist-packages/vcsi/vcsi.py", line 658, in select_sharpest_images
frame = do_capture(timestamp_tuple, desired_size[0], desired_size[1], suffix, args)
File "/usr/local/lib/python3.6/dist-packages/vcsi/vcsi.py", line 618, in do_capture
blurriness = media_capture.compute_blurriness(filename)
File "/usr/local/lib/python3.6/dist-packages/vcsi/vcsi.py", line 514, in compute_blurriness
i = Image.open(image_path)
File "/usr/local/lib/python3.6/dist-packages/PIL/Image.py", line 2862, in open
"cannot identify image file %r" % (filename if filename else fp)
PIL.UnidentifiedImageError: cannot identify image file '/tmp/tmpwfyg0_s3.png'

@GuguKatze
Copy link
Author

GuguKatze commented Mar 29, 2020

Also getting this: (will investigate later and create a separate issue)
/usr/local/lib/python3.6/dist-packages/vcsi/vcsi.py:522: RuntimeWarning: divide by zero encountered in double_scalars
return 1 / max_freq
/usr/local/lib/python3.6/dist-packages/vcsi/vcsi.py:522: RuntimeWarning: divide by zero encountered in double_scalars
return 1 / max_freq

@GuguKatze
Copy link
Author

GuguKatze commented Mar 29, 2020

I only get those errors when using the interval and grid with "0" value ... i.e.: "--start-delay-percent 0 --end-delay-percent 0 -width 1920 --grid 10x0 --interval 1m --grid-spacing 0" ... I will investigate later.

@GuguKatze
Copy link
Author

GuguKatze commented Mar 29, 2020

It only seems to happen with videos ending at a $duration % $interval == 0 situation ... i.e. ... there seems to be a "off by 1" error in terms of frames or something ...

... I am using an interval of 60 seconds ... i.e. generate a preview tile every minute ... and I get the mentioned error only with mp4 files ending at :00 seconds ... (i.e. $duration % 60 == 0)

Using "--end-delay-percent 1" does fix the issue ... but it's not elegant ... there seems to be a check missing that checks whether there is enough mp4 "left" in order to create the preview tile?

@GuguKatze GuguKatze changed the title Random strange error? mp4 ending at ($duration % $interval == 0) causing issues. (Quick fix provided) Mar 29, 2020
zacker150 added a commit to zacker150/vcsi that referenced this issue Apr 11, 2020
Fixed crash when duration is an exact multiple of interval
@amietn amietn added the bug label Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants