问题
This program does not play videos but the sound is okey. I get an error about h264 or MJPG.When trying to play an .mp4 or .avi file I see the this messages.
main decoder error: Codec `MJPG' (Motion JPEG Video) is not supported.
main decoder error: Codec not supported
main decoder error: VLC could not decode the format "MJPG" (Motion JPEG Video)
or
main decoder error:Codec `h264' (H264 - MPEG-4 AVC (part 10)) is not supported.
main decoder error: Codec not supported
main decoder error: VLC could not decode the format "h264" (H264 - MPEG-4 AVC (part 10))
and this is my code
import vlc
from time import sleep
Instance = vlc.Instance('--fullscreen')
player = Instance.media_player_new()
Media = Instance.media_new('/home/onur/video_005.avi') #Media Location
Media.get_mrl()
player.set_media(Media)
player.play()
sleep(5) # Or however long you expect it to take to open vlc
while player.is_playing():
sleep(1)
来源:https://stackoverflow.com/questions/59993103/python-does-not-play-mp4-and-avi-files