[Workaround] How to filter new AV01 codec with youtube-dl?

Everything about X, Gnome, KDE, ... and everything running on it

[Workaround] How to filter new AV01 codec with youtube-dl?

Postby bester69 » 2020-02-12 20:23

Hi,

I have problems with new youtube codec av1, mpv 0,28 doesnt read it, and mpv0,29 give me some lags.. So I would need a --ytdl-format filter in youtube-dl
to exclude that chain stream.:

Here, for example
youtube-dl -F https://www.youtube.com/watch?v=8EJ-vZyBzOQ
136 mp4 1280x720 720p 659k , avc1.4d401f, 25fps, video only, 8.78MiB
247 webm 1280x720 720p 767k , vp9, 25fps, video only, 10.74MiB
398 mp4 1280x720 720p 1073k , av01.0.05M.08, 25fps, video only, 16.43MiB


here, I can play vid by giving it directly by id number track=136 (AVC1) ==> this codec is supported by mpv28
mpv --ytdl-format=136 https://www.youtube.com/watch?v=8EJ-vZyBzOQ

here, I can't play vid, id number track=398 (AV01) ==> this codec is not supported by mpv28
mpv --ytdl-format=398 https://www.youtube.com/watch?v=8EJ-vZyBzOQ

So, I know How can I filter vp9 codec(vcodec!=?vp9) or open vp9 (vcodec=vp9), but I dont know how to name that AVC1 codec so mpv know it.

This filter work for WEBM container.:
soun_uri="https://www.youtube.com/watch?v=8EJ-vZyBzOQ"
LIBGL_DEBUG=verbose mpv \
--ytdl-format="bestvideo[ext=webm][vcodec=vp9][height<=?720]+bestaudio[ext=webm]" "$soun_uri"

--------
AVC1 is supported, so I would need to exclude AV01

What Codec name do i use for AVC H.264 or MPEG-4 Part 10??? :?: (AVC1)
soun_uri="https://www.youtube.com/watch?v=8EJ-vZyBzOQ"
LIBGL_DEBUG=verbose mpv \
--ytdl-format="bestvideo[ext=mp4][vcodec= :?: XXXXXX :?: ][height<=?720]+bestaudio[ext=m4a]" "$soun_uri"

Ive tried with:
vcodec=h264
vcodec=libx264
vcodec=avc1.. and some more.
Last edited by bester69 on 2020-02-12 21:37, edited 2 times in total.
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1609
Joined: 2015-04-02 13:15

Re: How to filter new av1 codec with youtube-dl?

Postby bester69 » 2020-02-12 20:32

VLC neither support it :shock:

cvlc $(youtube-dl -f 398 -g https://www.youtube.com/watch?v=8EJ-vZyBzOQ)
VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
[00007fabcc0113e0] main decoder error: Codec `av01' (AOMedia's AV1 Video) is not supported.
[00007fabcc0113e0] main decoder error: Códec no soportado
[....
[00007fabcc000b50] main tls client error: connection error: Network is unreachable
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1609
Joined: 2015-04-02 13:15

Re: How to filter new AV01 codec with youtube-dl?

Postby bester69 » 2020-02-12 21:26

Workaround for resolution <=720p
soun_uri="https://www.youtube.com/watch?v=8EJ-vZyBzOQ"

Workaround for mp4 (<=720p):
svideo=$(youtube-dl -F "$soun_uri"|grep avc1|sort -k 4| tail -n 1 | awk '{ print $1 }')
mpv --save-position-on-quit --ytdl-format="$svideo+140" "$soun_uri"


And Solution for webm.:
mpv --save-position-on-quit \
--ytdl-format="bestvideo[ext=webm][height<=?720]+bestaudio[ext=webm]" "$soun_uri"
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1609
Joined: 2015-04-02 13:15

Re: [Workaround] How to filter new AV01 codec with youtube-d

Postby stevepusser » 2020-02-13 01:32

VLC has to be built against an ffmpeg that also supports the AV01 codec--like the VLC in MX 17/18 on a Stretch base... :D
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Kodi 18.6, Strawberry 0.6.11, Muse 3.1.0, Chromium with va-api, Audacity 2.4.1, Kdenlive 20.04
User avatar
stevepusser
 
Posts: 11695
Joined: 2009-10-06 05:53

Re: [Workaround] How to filter new AV01 codec with youtube-d

Postby bester69 » 2020-02-13 13:14

stevepusser wrote:VLC has to be built against an ffmpeg that also supports the AV01 codec--like the VLC in MX 17/18 on a Stretch base... :D

I guess It would be the same for mpv28.. everything has to be recompiled against a newer ffmpeg version that contains that codec.. I installed mpv29 and wen back to mpv28, ..mpv29 through smplayer (in my case) doesnt pick the right video chain stream resolution, It goes for a lower resolution...furthermore It eats more CPU than mpv28 and new codec av01 is not able to run properly en my old Acer Extensa5230..It happend something similar to h265 codec. ..I wonder if that new youtube codec is (new generation) same kind of codec that h265.

I guess Its hight time to buy a new laptop.. obsolescence is getting very close for my 2008's laptop... A good thing ive realised is that h264 enconding has improved a lot, now,you can see 720p ripped videos with just less than 1GbB with very hight quality, when in pass years they usually have between 2 or 3 Gby for even lower qualitys... Ive even realised that 1080p h264, seems to run smoother in my lowspec computers than before, still some moments of lag in 1080p. :D
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1609
Joined: 2015-04-02 13:15


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 15 guests

fashionable