Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7457 closed defect (invalid)

FFplay slow youtube streaming

Reported by: chenrios Owned by:
Priority: normal Component: ffplay
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
FFplay is downloading the video at around 21.8Mbps which is not sufficient at 4k60fps and causes buffering. Chrome / Firefox buffers the video perfectly fine on my 300Mbps line.

How to reproduce:

  1. get youtube video which has 4k 60fps format available like e.g. youtube-dl -f 315 -g https://youtu.be/imZYzSOV27g
  2. pass output URL to ffplay
  3. after ~30seconds video starts to buffer
    % ffplay version N-91961-g5109c38162 Copyright (c) 2003-2018 the FFmpeg developers
      built with gcc 8.2.1 (GCC) 20180813
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
      libavutil      56. 19.101 / 56. 19.101
      libavcodec     58. 30.100 / 58. 30.100
      libavformat    58. 18.101 / 58. 18.101
      libavdevice    58.  4.103 / 58.  4.103
      libavfilter     7. 32.100 /  7. 32.100
      libswscale      5.  2.100 /  5.  2.100
      libswresample   3.  2.100 /  3.  2.100
      libpostproc    55.  2.100 / 55.  2.100
    Input #0, matroska,webm, from 'https://r2---sn-2gb7sn7k.googlevideo.com/videoplayback?[redacted]':
      Metadata:
        encoder         : google/video-file
      Duration: 00:10:06.62, start: 0.000000, bitrate: 22188 kb/s
        Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709), 3840x2160, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
    

Change History (3)

comment:1 by Marton Balint, 6 years ago

Resolution: invalid
Status: newclosed

Youtube is rate limiting download speed, and the video has parts which have a larger bitrate then the rate limit. So it won't work with other players either. Even happens on chrome after roughly 1:10. Wget also can't get a faster download speed after the initial "burst".

You may use -infbuf with ffplay to make it buffer as much data as possible, but you will still run out of data eventually.

comment:2 by chenrios, 6 years ago

there's a way to avoid this https://github.com/rg3/youtube-dl/issues/15384#issuecomment-359654155
can something similar be implemented into ffplay?

comment:3 by jeeb, 6 years ago

Since the actual Youtube JS player seems to access the things not with actual ranged requests but instead custom URL parameters that contain the ranges, I think if youtube-dl would be able to create a playlist of those chunks a la HLS or DASH playlist/manifest then it could be played.

Ranged requests could be implemented, but you'd have to tell the ranges to lavf somehow. It's extra complexity and if you can just make a playlist/manifest with the ranges in the URLs because the official player seems to access them that way, too - that would just be a whole bunch simpler.

Note: See TracTickets for help on using tickets.