diff options
author | metamuffin <metamuffin@disroot.org> | 2025-04-16 14:39:27 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-04-16 14:39:27 +0200 |
commit | a9c897c7d7df5509a195055e95dfa821fe7aa274 (patch) | |
tree | f7508de286fc3b5d830a2e540a514c30fa7a24c8 | |
parent | 39dee6820db4581fa41cfac8bcfdd399a96f5319 (diff) | |
download | jellything-a9c897c7d7df5509a195055e95dfa821fe7aa274.tar jellything-a9c897c7d7df5509a195055e95dfa821fe7aa274.tar.bz2 jellything-a9c897c7d7df5509a195055e95dfa821fe7aa274.tar.zst |
the typical mse problems again...
-rw-r--r-- | remuxer/src/mpeg4.rs | 2 | ||||
-rw-r--r-- | transcoder/src/fragment.rs | 8 | ||||
-rw-r--r-- | web/script/player/download.ts | 2 | ||||
-rw-r--r-- | web/script/player/mediacaps.ts | 4 | ||||
-rw-r--r-- | web/script/player/track/mse.ts | 3 |
5 files changed, 12 insertions, 7 deletions
diff --git a/remuxer/src/mpeg4.rs b/remuxer/src/mpeg4.rs index 9e59514..da66fe2 100644 --- a/remuxer/src/mpeg4.rs +++ b/remuxer/src/mpeg4.rs @@ -16,7 +16,7 @@ pub fn matroska_to_mpeg4( mut output: impl Write, ) -> Result<()> { let path = format!("/tmp/jellything-tc-hack-{:016x}", random::<u64>()); - let args = format!("-f matroska -i pipe:0 -c copy -map 0 -f mp4 {path}"); + let args = format!("-f matroska -i pipe:0 -copyts -c copy -f mp4 {path}"); let mut child = Command::new("ffmpeg") .args(args.split(" ")) .stdin(Stdio::piped()) diff --git a/transcoder/src/fragment.rs b/transcoder/src/fragment.rs index 8692423..88a311e 100644 --- a/transcoder/src/fragment.rs +++ b/transcoder/src/fragment.rs @@ -56,19 +56,23 @@ pub async fn transcode( }; let fallback_encoder = match format.codec.as_str() { "A_OPUS" => "libopus", + "V_VP8" => "libvpx", + "V_VP9" => "libvpx-vp9", + "V_AV1" => "libaom", // svtav1 is x86 only :( "V_MPEG4/ISO/AVC" => "libx264", "V_MPEGH/ISO/HEVC" => "libx265", _ => "", }; let args = template - .replace("%i", "-f matroska -i pipe:0") + .replace("%i", "-f matroska -i pipe:0 -copyts") .replace("%o", "-f matroska pipe:1") .replace("%f", &filter) .replace("%e", "-c:%t %c -b:%t %r") .replace("%t", typechar) .replace("%c", fallback_encoder) - .replace("%r", &(format.bitrate as i64).to_string()); + .replace("%r", &(format.bitrate as i64).to_string()) + .replace(" ", " "); info!("encoding with {:?}", args); diff --git a/web/script/player/download.ts b/web/script/player/download.ts index 18f1e8d..8294d2a 100644 --- a/web/script/player/download.ts +++ b/web/script/player/download.ts @@ -20,7 +20,7 @@ export class SegmentDownloader { const dl_start = performance.now(); const res = await fetch(url) const dl_header = performance.now(); - if (!res.ok) throw new Error("aaaaa"); + if (!res.ok) throw new Error("aaaaaa"); const buf = await res.arrayBuffer() const dl_body = performance.now(); diff --git a/web/script/player/mediacaps.ts b/web/script/player/mediacaps.ts index 29cd64a..3c55aa9 100644 --- a/web/script/player/mediacaps.ts +++ b/web/script/player/mediacaps.ts @@ -63,8 +63,8 @@ const MASTROSKA_CODEC_MAP: { [key: string]: string } = { "V_VP9": "vp9", "V_VP8": "vp8", "V_AV1": "av1", - "V_MPEG4/ISO/AVC": "avc1.4d002a", - "V_MPEGH/ISO/HEVC": "h265", + "V_MPEG4/ISO/AVC": "avc1.42C01F", + "V_MPEGH/ISO/HEVC": "hev1.1.6.L93.90", "A_OPUS": "opus", "A_VORBIS": "vorbis", "S_TEXT/WEBVTT": "webvtt", diff --git a/web/script/player/track/mse.ts b/web/script/player/track/mse.ts index 199aa14..6bb77e0 100644 --- a/web/script/player/track/mse.ts +++ b/web/script/player/track/mse.ts @@ -154,7 +154,8 @@ export class MSEPlayerTrack extends PlayerTrack { this.current_load = frag; // TODO why is appending so unreliable?! sometimes it does not add it this.source_buffer.changeType(track_to_content_type(this.active_format.value!.format, this.active_format.value!.container)); - this.source_buffer.timestampOffset = this.active_format.value?.format.remux ? 0 : frag.start + // this.source_buffer.timestampOffset = this.active_format.value?.format.remux ? 0 : frag.start + this.source_buffer.timestampOffset = 0 console.log(`append track at ${this.source_buffer.timestampOffset} ${this.trackinfo.kind} ${this.track_index}`); this.source_buffer.appendBuffer(frag.buf); } |