question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

videos with highest resolution cannot be played by vlc player

See original GitHub issue

I really like VLC player because it has slow motion, and it is very simple so getting videos to work with VLC player using pytube is a must. In any case, I noticed that the following syntax does not get the stream with the best resolution:

yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download( save_path)

So I came up with the following:

`mp4files = yt.streams.filter(subtype=‘mp4’).all()

    dct = {}
    for f, stream in enumerate(mp4files):
        res = stream.fmt_profile['resolution']
        if res:
            num = int(res[:-1])
            dct.setdefault(num, []).append(f)
    highest = max(dct.keys())
    stream_num = dct[highest][0]
    mp4files[stream_num].download(save_path)`

However, the video downloaded by this code can be played by itunes and quicktime but not vlc player. What happens with the VLC player is that the video name will appear in its library but when you click on it nothing happens. When you download a stream which has 360p it can be played by the VLC player. The only differences between the two streams is that the 1080p stream has the following properties:

mp4files[1].is_progressive = False mp4files[1].codecs = [‘avc1.640028’] mp4files[1].fmt_profile[‘resolution’] = ‘1080p’ mp4files[0].is_progressive = True mp4files[0].fmt_profile[‘resolution’] = ‘360p’ mp4files[0].codecs = [‘avc1.640028’, ‘mp4a.40.2’]

Also, is this a github bug? When I put backticks around the above code it gets cut-off like so:

mp4files[1].is_progressive = False mp4files[1].codecs = ['avc1.640028'] mp4files[1].fmt_profile['resolution'] = '1080p' mp4files[0].is_progressive = True mp4files[0].fmt_profile['resolution'] = '360p' mp4files[0].codecs = ['avc1.640028', 'mp4a.40.2']

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kylefoley76commented, Nov 17, 2019

Actually the video with 1080 resolution does not have audio.

0reactions
github-actions[bot]commented, Aug 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can I not play a high quality video with VLC player?
Recently, I have downloaded a very high quality video (1920 x 1080 pixel, codec-H. 264/AVC,24FPS, audio codec-MPEG-4 AAC audio). I couldn't ...
Read more >
8 Methods to Play 4K Ultra HD Video in VLC Player
Methods to play 4K ultra HD videos in VLC Media Player · Update VLC Media player · Increase Cache Value · Change Video...
Read more >
How to Choose YouTube Video Quality or Resolution in VLC
How to Choose YouTube Video Quality or Resolution in VLC · Go to Tool > Preferences [CTRL + P]. · Click on All...
Read more >
VLC can't play high resolution movies - The VideoLAN Forums
When I try to play videos with resolutions of around 720x576 the screen is gray and the audio doesn't play very well.
Read more >
How to Change Video Quality in VLC Media Player
If a lower resolution is set, click on the drop-down arrow and select your preferred video resolution. Your video should now be able...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found