yt-dlp: select resolution and file format

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 380
Joined: Tue Nov 12, 2013 2:05 am

yt-dlp: select resolution and file format

Post by peter_b »

The following parameter selects a maximum resolution of 720 pixels (height), avc1 (=h.264) as video codec and mp4 as container format:

Code: Select all

$ yt-dlp -f "bv*[height<=720][ext=mp4][vcodec^=avc1]+ba*[ext=m4a]" URL
User avatar
peter_b
Chatterbox
Posts: 380
Joined: Tue Nov 12, 2013 2:05 am

Re: yt-dlp: add metadata!

Post by peter_b »

yt-dlp supports extended file attributes (EAs) - aka "xattrs" on Linux/MacOS:

Code: Select all

--xattrs     Write metadata to the video file's xattrs
                          (using dublin core and xdg standards)
This stores descriptive metadata *with* the downloaded object/file.

For example, the following video "Vessel" (by Conspiracy Demoscene Group) contains the following attributes when downloaded:
# file: Vessel [6sPP-_v-KFk].mp4
user.dublincore.contributor="Conspiracy"

user.dublincore.date="2017-04-25"

user.dublincore.description="Based on 'THAT WILL BE THE DAY', an audio/visual collaboration between composer Aldo Aréchar (http://aldoarechar.com) and motion graphics artist Matthew DiVito AKA Mr. Div (http://mrdiv.tumblr.com), \"Vessel\" is a 64 KByte realtime short film by Conspiracy. First presented at the Revision 2017 demoparty, where it reached 2nd place.\012\012Watch 'THAT WILL BE THE DAY' here:\012https://www.youtube.com/watch?v=zCQgGsHV_-I\012\012Download the realtime version and soundtrack of Vessel:\012http://conspiracy.hu/release/64k/vessel/\012\012Engine code and additional visuals by\012BOYC\012\012Visuals and direction by\012ZOOM\012\012Synth and music by\012GARGAJ\012\012http://www.conspiracy.hu\012http://facebook.com/conspiracy.hu\012http://twitter.com/conspiracyhu\012\012#conspiracy #demoscene #64k #intro #realtime #hungary"

user.dublincore.format="298 - 1280x540 (720p60)+140 - audio only (medium)"

user.dublincore.title="Vessel"

user.xdg.referrer.url="https://www.youtube.com/watch?v=6sPP-_v-KFk"
Post Reply