Using ffmpeg as thumbnail generator
This commit is contained in:
parent
5ac5aa361e
commit
1e31381fc4
@ -2,7 +2,7 @@
|
||||
Pytop is a Gtk + Python gui to have a custom desktop interface.
|
||||
|
||||
# Updates
|
||||
Added task bar.
|
||||
convirted to using ffmpeg to generate thumbnail.
|
||||
|
||||
# Notes
|
||||
```sudo apt-get install python3 wget steamcmd```
|
||||
|
Binary file not shown.
@ -50,7 +50,6 @@ class Icon:
|
||||
self.generateVideoThumbnail(fullPath, hashImgPth)
|
||||
|
||||
thumbnl = self.createScaledImage(hashImgPth, self.viIconWH)
|
||||
|
||||
if thumbnl == None: # If no icon whatsoever, return internal default
|
||||
thumbnl = gtk.Image.new_from_file(self.SCRIPT_PTH + "../resources/icons/video.png")
|
||||
|
||||
@ -175,8 +174,9 @@ class Icon:
|
||||
return None
|
||||
|
||||
def generateVideoThumbnail(self, fullPath, hashImgPth):
|
||||
proc = None
|
||||
try:
|
||||
proc = subprocess.Popen([self.thubnailGen, "-t", "65%", "-s", "300", "-c", "jpg", "-i", fullPath, "-o", hashImgPth])
|
||||
proc = subprocess.Popen(["ffmpeg", "-i", fullPath, "-vframes", "1", "-s", "320x180", "-q:v", "2", hashImgPth])
|
||||
proc.wait()
|
||||
except Exception as e:
|
||||
print("Video thumbnail generation issue in thread:")
|
||||
|
Loading…
Reference in New Issue
Block a user