scottlamb / retina

High-level RTSP multimedia streaming library, in Rust
https://crates.io/crates/retina
Apache License 2.0
244 stars 48 forks source link

Save RTSP in "fragmented" mp4 -> *.ts. #36

Closed nice-redbull closed 2 years ago

nice-redbull commented 3 years ago

hi Scott,

is it possible to save RTSP in "fragmented / fmp4 / *.ts " mp4 to get rid of "seek" when recording?

        self.inner
            .seek(SeekFrom::Start(u64::from(self.mdat_start - 8)))
            .await?;
        self.inner
            .write_all(&u32::try_from(self.mdat_pos + 8 - self.mdat_start)?.to_be_bytes()[..])
            .await?;
scottlamb commented 3 years ago

Yes, I'm sure it's possible to write into some purely sequential format. But I'm intending Retina to be "just" an RTSP library with some examples of how to use it, not a full equivalent of ffmpeg or the like. So unless the implementation is really simple (ideally simpler than what we already have), I think that probably belongs in a separate crate.