`yt-dlp` limited

If I run

yt-dlp --embed-metadata --merge-output-format ts -- -U3BgoGwQv4

on another OS, the referenced video is downloaded. On NixOS the output is:

Usage: yt-dlp [OPTIONS] URL [URL...]

yt-dlp: error: invalid merge output format "ts" given

Can that be fixed?

What version of yt-dlp is on the other OS? Nix has the most recent release “2022.10.04”. And according to the man pages “ts” is not a valid merge output format.

–merge-output-format FORMAT
Containers that may be used when merging formats,separated by “/”, e.g. “mp4/mkv”. Ignored if no merge is required. (currently supported: avi, flv, mkv, mov, mp4, webm)

Is “ts” a deprecated format or were you using another variant of youtube-dl?

ts here means MPEG transport stream. It is not a codec but a container format.

yt-dlp -h on the other (Rocky Linux) system also lists the valid options to --merge-output-format as mkv, mp4, ogg, webm and flv – no others.

I’m definitely running yt-dlp and not youtube-dl.

yt-dlp --version on the Rocky Linux system outputs 2022.07.18 and on NixOS, 2022.10.04. So it is possible that for some reason the ts output option has been removed from yt-dlp.

[Later] The command yt-dlp --embed-metadata --hls-use-mpegts -o -U3BgoGwQv4.ts -- -U3BgoGwQv4 works on both, so I’ll run with that.

Thanks for your reply.

Looking at the relaese notes, the version after “2022.07.18” has " * Validate --merge-output-format" in it’s changelog. I don’t know enough about yt-dlp but I don’t think the --merge-output-format in your original command is used correctly, it just wasn’t caught in the older version. If it was used right, you can get an older version of yt-dlp by either writting an overlay or downloading from an older version of nixpkgs

nix shell "github:NixOS/nixpkgs/nixos-21.11#yt-dlp"

Should give you version “2022.05.18” and it seems like the original command you gave is working for me (no longer getting the “invalidi merge output format” error.

You should verify whether that actually produces files in the ts format or just names the file that way but it’s a different format.

Yes, we soon realised that there is a discrepancy between naming and output format there.