videoscripts icon indicating copy to clipboard operation
videoscripts copied to clipboard

Python 3 conversion?

Open dprestegard opened this issue 4 years ago • 5 comments

Any chance we could get this converted to Python 3?

I tried the trusty old 2to3 but it blows up after thumbnail generation:

9 thumbs written in /mnt/videoscripts/sprites/thumbs/test_encode_vtt
START [2020-03-19 20:44:25.282928] : mogrify -geometry 100x /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv002.jpg /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv003.jpg /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv004.jpg /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv005.jpg /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv006.jpg /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv007.jpg /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv008.jpg /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv009.jpg /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv010.jpg
END   [2020-03-19 20:44:25.497202]
b''
START [2020-03-19 20:44:25.497783] : identify -format "%g - %f
" /mnt/videoscripts/sprites/thumbs/test_encode_vtt/tv002.jpg
END   [2020-03-19 20:44:25.507754]
b'100x56+0+0 - tv002.jpg\n'
Traceback (most recent call last):
  File "makesprites.py", line 292, in <module>
    run(task)
  File "makesprites.py", line 259, in run
    coords = get_geometry(thumbfiles[0]) #use the first file (since they are all same size) to get geometry settings
  File "makesprites.py", line 145, in get_geometry
    parts = geom.split("-",1)
TypeError: a bytes-like object is required, not 'str'

dprestegard avatar Mar 19 '20 20:03 dprestegard

https://github.com/vlanard/videoscripts/pull/16

dprestegard avatar Mar 19 '20 21:03 dprestegard

Btw you can check my fork for python3 compatibility and minor improvements

JollyGoal avatar Jun 02 '21 09:06 JollyGoal

Btw you can check my fork for python3 compatibility and minor improvements

hi, it's not working out of the box, could you just rewrite her script in python3 language? thanks

the issue you see if your script works for one video at a time. this script is called batchsprites for a reason, this is what I use to do:

cd to videos dir ls -d -1 $PWD/.mp4 > videos.txt python batchsprites.py videos.txt

all videos in the folder would have a sprite conversion job.

campones avatar Jan 06 '22 16:01 campones

Btw you can check my fork for python3 compatibility and minor improvements

hi, it's not working out of the box, could you just rewrite her script in python3 language? thanks

the issue you see if your script works for one video at a time. this script is called batchsprites for a reason, this is what I use to do:

cd to videos dir ls -d -1 $PWD/.mp4 > videos.txt python batchsprites.py videos.txt

all videos in the folder would have a sprite conversion job.

Hey, I guess I've added feature you needed. Check it if you still need it. And it is more a feature request rather than an issue so I don't think it is relevant to request it here :)

JollyGoal avatar Jan 20 '22 19:01 JollyGoal

yes and no. basically what op asked was a translation of the original script to python3. so we wouldn't lose any functionalities

campones avatar Jan 20 '22 19:01 campones