python-vlc
python-vlc copied to clipboard
Linux segfault while taking snapshot from youtube
try:
import vlc
except:
print('Error')
print('Please install python-vlc')
exit(1)
import time
import numpy as np
from ctypes import *
class MyDisplay(vlc.VideoDisplayCb):
def __doc__(o,p):
print("fsdfs")
if __name__ == '__main__':
url = 'https://www.youtube.com/watch?v=T8r_Gc6Pg6o&t=3227s'
#url = 'https://www.youtube.com/watch?v=K6orZrwys1k'
i = vlc.Instance('--no-audio', '-q')
media = i.media_new(url)
media_list = i.media_list_new([url])
print(media_list)
p = i.media_player_new()
p.set_media(media)
lp = i.media_list_player_new()
lp.set_media_player(p)
lp.set_media_list(media_list)
p.play()
time.sleep(5)
r = p.video_take_snapshot(0,'/home/marat/Music/rnd.jpg',0,0)
Console ouput:
This is not a python-vlc issue, rather a vaapi/libva issue. If you search for "libva info: va_openDriver() returns 0 Segfault (core dumped) " you will find other software having the same issue, with solutions ranging from uninstalling libva to exporting a variable (in https://github.com/OpenKinect/libfreenect2/issues/1159 ). If you manage to find the appropriate remedy for you, please post it in this issue so that other people can benefit from it.