emarsden / dash-mpd-rs

Rust library for parsing, serializing and downloading media content from a DASH MPD manifest.
MIT License
72 stars 23 forks source link

Fetch audio and video without muxing #25

Closed sleepycatcoding closed 1 year ago

sleepycatcoding commented 1 year ago

Is there a way to download video and audio without muxing them into one file? I would like to have them as separate files.

sleepycatcoding commented 1 year ago

Actually I found a way to accomplish this by using audio_only() and video_only(), but this requires two requests to the manifest file. I do not know if reqwest caches requests to the same file.

emarsden commented 1 year ago

You can use DashDownloader::new(url).keep_audio().keep_video(). This doesn't in fact disable the muxing step but will keep the audio and video as separate files (assuming they are separate content streams).

sleepycatcoding commented 1 year ago

You can use DashDownloader::new(url).keep_audio().keep_video(). This doesn't in fact disable the muxing step but will keep the audio and video as separate files (assuming they are separate content streams).

If I were to use keep_audio() and keep_video(), is there a way to fetch paths to the files?

EDIT:

Seems the paths are only printed to stdout. https://github.com/emarsden/dash-mpd-rs/blob/2135788f10e03c3d2ed57b046eadf5593013c010/src/fetch.rs#L2048-L2057

emarsden commented 1 year ago

Indeed, there's no API to retrieve that information. Perhaps it would be better to change the interface to something like keep_audio_as(audio-pathname) .

sleepycatcoding commented 1 year ago

Indeed, there's no API to retrieve that information. Perhaps it would be better to change the interface to something like keep_audio_as(audio-pathname) .

Created a draft PR for this: #26.