[MPlayer-users] Parsing whole Youtube mp4 file before playing?

wm4 nfxjfg at googlemail.com
Fri Jun 5 09:19:27 CEST 2015


On Fri, 5 Jun 2015 03:39:31 +0200
Rasz <citizenr at gmail.com> wrote:

> Mplayer (libavcodec?) parses some mp4 files encoded by google/YT all
> the way to the end preventing streaming. Here is an example:
> 
> --------------------------------------------
> D:\_learning>youtube-dl.exe https://www.youtube.com/watch?v=M3IgHiWq5x4 -F
> [youtube] M3IgHiWq5x4: Downloading webpage
> [youtube] M3IgHiWq5x4: Extracting video information
> [youtube] M3IgHiWq5x4: Downloading DASH manifest
> [info] Available formats for M3IgHiWq5x4:
> format code  extension  resolution note
> 140          m4a        audio only DASH audio  129k , m4a_dash
> container, aac  @128k (44100Hz), 27.84MiB
> 171          webm       audio only DASH audio  149k , audio at 128k
> (44100Hz), 24.75MiB
> 141          m4a        audio only DASH audio  257k , m4a_dash
> container, aac  @256k (44100Hz), 55.89MiB
> 160          mp4        256x144    DASH video  115k , 15fps, video
> only, 23.71MiB
> 278          webm       256x144    DASH video  144k , webm container,
> VP9, 15fps, video only, 22.78MiB
> 133          mp4        426x240    DASH video  252k , 30fps, video
> only, 53.20MiB
> 242          webm       426x240    DASH video  293k , 30fps, video
> only, 44.73MiB
> 243          webm       640x360    DASH video  546k , 30fps, video
> only, 85.39MiB
> 134          mp4        640x360    DASH video  634k , 30fps, video
> only, 95.42MiB
> 244          webm       854x480    DASH video 1045k , 30fps, video
> only, 157.52MiB
> 135          mp4        854x480    DASH video 1134k , 30fps, video
> only, 187.37MiB
> 247          webm       1280x720   DASH video 2192k , 30fps, video
> only, 326.61MiB
> 136          mp4        1280x720   DASH video 2262k , 30fps, video
> only, 362.02MiB
> 248          webm       1920x1080  DASH video 3968k , 30fps, video
> only, 605.60MiB
> 137          mp4        1920x1080  DASH video 4219k , 30fps, video
> only, 668.94MiB
> 17           3gp        176x144
> 36           3gp        320x240
> 5            flv        400x240
> 43           webm       640x360
> 18           mp4        640x360
> 22           mp4        1280x720   (best)
> 
> Format 22 is ordinary mp4 video+audio file and streams perfectly
> (thats what I use daily)
> D:\_learning>for /f "delims=" %A in ('youtube-dl.exe
> "https://www.youtube.com/watch?v=M3IgHiWq5x4" -f 22 -g') do
> @C:\Users\bofh\AppData\Roaming\smplayer\mplayer\mplayer "%A"
> 
> Format 248 is video only webm and also plays fine
> D:\_learning>for /f "delims=" %A in ('youtube-dl.exe
> "https://www.youtube.com/watch?v=M3IgHiWq5x4" -f 248 -g') do
> @C:\Users\bofh\AppData\Roaming\smplayer\mplayer\mplayer "%A"
> 
> Problem lies in Format 137 video only mp4. Instead of playing
> immediately mplayer starts parsing this file piece by piece reading
> chunks every couple of megabytes
> D:\_learning>for /f "delims=" %A in ('youtube-dl.exe
> "https://www.youtube.com/watch?v=M3IgHiWq5x4" -f 137 -g') do
> @C:\Users\bofh\AppData\Roaming\smplayer\mplayer\mplayer "%A" -v
> 
> ....
> [https @ 0000000001544180]header='Content-Range: bytes 0-701448021/701448022'
> [https @ 0000000001544180]header='Accept-Ranges: bytes'
> [https @ 0000000001544180]header='Content-Length: 701448022'
> ....
> [https @ 0000000001544180]header='Content-Range: bytes
> 1228800-701448021/701448022'
> [https @ 0000000001544180]header='Accept-Ranges: bytes'
> [https @ 0000000001544180]header='Content-Length: 700219222'
> ....
> [https @ 0000000001544180]header='Content-Range: bytes
> 1302528-701448021/701448022'
> [https @ 0000000001544180]header='Accept-Ranges: bytes'
> [https @ 0000000001544180]header='Content-Length: 700145494'
> ....
> [https @ 0000000001544180]header='Content-Range: bytes
> 1957888-701448021/701448022'
> [https @ 0000000001544180]header='Accept-Ranges: bytes'
> [https @ 0000000001544180]header='Content-Length: 699490134'
> ....
> [https @ 0000000001544180]header='Content-Range: bytes
> 4718592-701448021/701448022'
> [https @ 0000000001544180]header='Accept-Ranges: bytes'
> [https @ 0000000001544180]header='Content-Length: 696729430'
> ....
> [https @ 0000000001544180]header='Content-Range: bytes
> 7479296-701448021/701448022'
> [https @ 0000000001544180]header='Accept-Ranges: bytes'
> [https @ 0000000001544180]header='Content-Length: 693968726'
> ....
> [https @ 0000000001544180]header='Content-Range: bytes
> 10235904-701448021/701448022'
> [https @ 0000000001544180]header='Accept-Ranges: bytes'
> [https @ 0000000001544180]header='Content-Length: 691212118'
> ....and so on
> 
> it will eventually start playing after parsing whole file this way. I
> would simply guess its one of those weird containers with metadata all
> over the place and there is no way around it, except both Youtube
> HTML5 and Flash video players stream this file fine without reading
> all over the place. Same goes for m4a (formats 140, 141). Is this
> mplayer or libavcodec issue? any way to do something about it?
> 
> 

libavcodec. It's because the mp4 file is "fragmented". It works if you
disable indexing.


More information about the MPlayer-users mailing list