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

mp4 example: avoid half-written output file #32

Closed scottlamb closed 3 years ago

scottlamb commented 3 years ago

Right now the .mp4 example writes directly to the output filename and only writes the moov information on success. So if there's an error (eg in https://github.com/scottlamb/retina/issues/30#issuecomment-907557410) you end up with a .mp4 file which doesn't play correctly. I don't want to complicate it too much (given that it's just an example rather than intended to be a fully productionized tool) but I think it'd be simple enough to do the following: