emarsden / dash-mpd-cli

Download media content from a DASH-MPEG or DASH-WebM MPD manifest
https://emarsden.github.io/dash-mpd-cli/
MIT License
293 stars 33 forks source link

Option to manually select the video stream? #11

Closed leovbernardo closed 1 year ago

leovbernardo commented 1 year ago

Hello Eric, Hope all is well :-)

Not really sure where to post this question/issue/request, so please apologize and feel free to close this issue if it shouldn't be here.

Apparently, the tool does not allow you to manually select which video stream you want to download from multiple options in the MPD. Please see the example below:

DASH manifest has 1 period Streams in period 1 (# 1), duration 2673.085s: audio mp4a.40.2 | 125 Kbps | lang=en audio mp4a.40.2 | 125 Kbps | lang=pt video avc1.64001E | 351 Kbps | 640x360 video avc1.64001E | 614 Kbps | 640x360 video avc1.64001F | 1068 Kbps | 854x480 video avc1.64001F | 1915 Kbps | 1280x720 video avc1.640028 | 2965 Kbps | 1280x720 subs Wvtt/wvtt | pt | subs Vtt | pt |

--quality best = downloads the stream "video avc1.640028 | 2965 Kbps | 1280x720" --quality worst = downloads the stream "video avc1.64001E | 351 Kbps | 640x360"

But what if I wanted to download this stream: "video avc1.64001F | 1915 Kbps | 1280x720"? Is there a way to force which stream to be selected; something similar to the argument "--prefer-language"?

Thanks in advance!

emarsden commented 1 year ago

Indeed, that would be a useful option, something like --target-width or --target-bandwidth or --period-id.

leovbernardo commented 1 year ago

Thanks for considering Eric.

I was reading the Rusk code of dash-mpd/fetch.rs and around row line 1476 it's the code handling video streams. The limitation seems to be in that part of the code that offers two options only to select the stream: minimum number = highest quality; maximum number = lowest quality. It lacks a "line item" selection.

Sorry if this is redundant information for you. Was just trying to find the source of the limitation.

Thanks!

emarsden commented 1 year ago

Implemented in the latest release v0.2.5, see --prefer-video-width and --prefer-video-height.

Thanks

leovbernardo commented 12 months ago

Thanks man! You're good!