pub struct TranscodeSession { /* private fields */ }
Implementations§
Source§impl TranscodeSession
impl TranscodeSession
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
The session ID allows for re-retrieving this session at a later date.
pub fn is_offline(&self) -> bool
Sourcepub fn container(&self) -> ContainerFormat
pub fn container(&self) -> ContainerFormat
The selected container.
pub fn video_transcode(&self) -> Option<(Decision, VideoCodec)>
pub fn audio_transcode(&self) -> Option<(Decision, AudioCodec)>
Sourcepub async fn download<W>(&self, writer: W) -> Result<()>where
W: AsyncWrite + Unpin,
pub async fn download<W>(&self, writer: W) -> Result<()>where
W: AsyncWrite + Unpin,
Downloads the transcoded data to the provided writer.
For streaming transcodes (MPEG-DASH or HLS) this will return the playlist data. This crate doesn’t contain any support for processing these streaming formats and figuring out how to use them is currently left as an exercise for the caller.
For offline transcodes it is possible to start downloading before the transcode is complete. In this case any data already transcoded is downloaded and then the connection will remain open and more data will be delivered to the writer as it becomes available. This can mean that the HTTP connection is idle for long periods of time waiting for more data to be transcoded and so the normal timeouts are disabled for offline transcode downloads.
Unfortunately there does not appear to be any way to restart downloads from a specific point in the file. So if the download fails for any reason you have to start downloading all over again. It may make more sense to wait until the transcode is complete or nearly complete before attempting download.
pub async fn status(&self) -> Result<TranscodeStatus>
Sourcepub async fn stats(&self) -> Result<TranscodeSessionStats>
pub async fn stats(&self) -> Result<TranscodeSessionStats>
Retrieves the current transcode stats.
Sourcepub async fn cancel(self) -> Result<()>
pub async fn cancel(self) -> Result<()>
Cancels the transcode and removes any transcoded data from the server.
NB! Be careful with cancelling sessions too often! Cancelling a few transcoding sessions in a short succession, or cancelling a session shortly after it was initiated might crash the Plex server. At least the one running inside a Linux Docker Container.