ec-node: WebTransport publish + web hang-watch
This commit is contained in:
parent
791c7beee7
commit
339aef50e0
19 changed files with 1355 additions and 2229 deletions
|
|
@ -1,5 +1,6 @@
|
|||
//! Deterministic chunking and transcode scaffolding.
|
||||
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
use ac_ffmpeg::format::{
|
||||
demuxer::Demuxer,
|
||||
io::IO,
|
||||
|
|
@ -15,6 +16,7 @@ use std::fs;
|
|||
use std::io::{Read, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Child, Command, Stdio};
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
use std::time::Duration;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
@ -202,6 +204,14 @@ pub fn collect_segments(output_dir: &Path) -> Result<ChunkManifest> {
|
|||
})
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ffmpeg-ffi"))]
|
||||
pub fn probe_read_stream<T: Read>(_stream: T) -> Result<Vec<StreamProbe>> {
|
||||
Err(anyhow!(
|
||||
"probe_read_stream requires feature `ec-chopper/ffmpeg-ffi` (ac-ffmpeg) and FFmpeg headers"
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
pub fn probe_read_stream<T: Read>(stream: T) -> Result<Vec<StreamProbe>> {
|
||||
let io = IO::from_read_stream(stream);
|
||||
let demuxer = Demuxer::builder()
|
||||
|
|
@ -401,6 +411,19 @@ pub fn hash_file_blake3(path: &Path) -> Result<String> {
|
|||
Ok(hasher.finalize().to_hex().to_string())
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ffmpeg-ffi"))]
|
||||
pub fn chunk_stream_ffmpeg<T: Read>(
|
||||
_stream: T,
|
||||
_output_dir: &Path,
|
||||
_chunk_duration_ms: u64,
|
||||
_max_chunks: Option<usize>,
|
||||
) -> Result<TsChunkManifest> {
|
||||
Err(anyhow!(
|
||||
"chunk_stream_ffmpeg requires feature `ec-chopper/ffmpeg-ffi` (ac-ffmpeg)"
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
pub fn chunk_stream_ffmpeg<T: Read>(
|
||||
stream: T,
|
||||
output_dir: &Path,
|
||||
|
|
@ -610,6 +633,20 @@ pub fn manifest_for_ts_chunks(
|
|||
Ok((body, hashed))
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ffmpeg-ffi"))]
|
||||
pub fn chunk_stream_ffmpeg_live<T: Read, F: FnMut(TsChunk) -> Result<()>>(
|
||||
_stream: T,
|
||||
_output_dir: &Path,
|
||||
_chunk_duration_ms: u64,
|
||||
_max_chunks: Option<usize>,
|
||||
_on_chunk: F,
|
||||
) -> Result<()> {
|
||||
Err(anyhow!(
|
||||
"chunk_stream_ffmpeg_live requires feature `ec-chopper/ffmpeg-ffi` (ac-ffmpeg)"
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
pub fn chunk_stream_ffmpeg_live<T: Read, F: FnMut(TsChunk) -> Result<()>>(
|
||||
stream: T,
|
||||
output_dir: &Path,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue