mps-youtube / pafy

Python library to download YouTube content and retrieve metadata
1.38k stars 315 forks source link

MP4 Demux #271

Open blarwick opened 4 years ago

blarwick commented 4 years ago

I'm using pafy and vlc to pull down music off of a youtube video.

Example of a particular URL causing problems:

import pafy, vlc

instance = vlc.Instance()
player = instance.media_player_new()

pafy.new('https://www.youtube.com/watch?v=7jaN9B5zLzQ')
best = video.getbestaudio()
playurl = best.url
media = instance.media_new(playurl)
media.get_mrl()
player.set_media(media)
player.play

When I issue those python commands, stderr starts kicking out the following errors:

[113c5d68] mp4 demux: Fragment sequence discontinuity detected 1 != 0 [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 0 [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2 [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2 [10ba7aa0] main decoder error: buffer deadlock prevented [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2 [10ba8298] avcodec decoder: Using D3D11VA (Intel(R) UHD Graphics 620, vendor 8086(Intel), device 3ea0, revision 2) for hardware decoding [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2 [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2 [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2 [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2 [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2 [113c58e8] mp4 demux: Fragment sequence discontinuity detected 1 != 2

Is there any way to either: a) fix this so the music plays as originally desired b) catch these errors so that I can skip the song instead of dealing with 4 minutes of console error reporting while the song "finishes playing"

hillt03 commented 4 years ago

I ran into this issue a while ago. I found a way to somewhat mitigate the issue, but not completely get rid of it. IIRC it just makes it less spammy, but I'm not able to test right now since my YouTube projects aren't working because of API issues.

Anyways, here's what I did in my VLCYT project: I changed self.vlc_player.set_mrl(song_url) to self.vlc_player.set_mrl(song_url, ":no-video")

Other than that I submitted a post on StackOverflow a while ago and received no response.

DIvkov575 commented 2 years ago

Old discussion, but I was wondering what is the [00007ff82eb74560] mp4 demux: Fragment sequence discontinuity detected 1 != 0 error should I be concerned? or can I try to catch & ignore it? I am not fetching url's in my code even though I originally downloaded the audio off youtube