You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all input and output wrappers take AsRef<Path> parameter. This restricts the usage to local files only, but ffmpeg actually supports a lot of other protocols, including remote urls like http or rtsp
It should be possible to pass a custom url to ffmpeg.
I started to work on a PR to add support for URLs, but not sure which option would be the best:
Replace AsRef<Path> to ToString - this breaks current usage if someone passes Path
Add new methods like open_url(url: &str... - there are a few open/input/output function variants and will lead to duplication of many functions
Since the Path is converted to string anyway right away, is there a way to make the function signature accept both Path and &str? I wasn't able to find a way to do that, Path doesn't implement ToString nor std::fmt::Display
Safest way would be to add open_url functions, but I would prefer not to duplicate all these functions
Thoughts?
The text was updated successfully, but these errors were encountered:
encounter
pushed a commit
to encounter/rust-ffmpeg-zmwangx
that referenced
this issue
Oct 30, 2023
What about a new trait entirely, like MediaSource? Then you could impl<P: AsRef<Path>> MediaSource for P to preserve the existing callsites, but also add new impls for other sources.
Currently, all input and output wrappers take
AsRef<Path>
parameter. This restricts the usage to local files only, but ffmpeg actually supports a lot of other protocols, including remote urls like http or rtspIt should be possible to pass a custom url to ffmpeg.
I started to work on a PR to add support for URLs, but not sure which option would be the best:
AsRef<Path>
toToString
- this breaks current usage if someone passes Pathopen_url(url: &str...
- there are a few open/input/output function variants and will lead to duplication of many functionsPath
is converted to string anyway right away, is there a way to make the function signature accept bothPath
and&str
? I wasn't able to find a way to do that,Path
doesn't implementToString
norstd::fmt::Display
Safest way would be to add
open_url
functions, but I would prefer not to duplicate all these functionsThoughts?
The text was updated successfully, but these errors were encountered: