Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ package org.siloserver.silo.common.player.video

/**
* Containers Media3 opens directly for video sources.
*
* `m2ts` and `mts` are deliberately absent. Blu-ray and AVCHD files carry
* 192-byte BDAV packets, and Media3's `TsExtractor` reads only 188-byte
* transport-stream packets, so no extractor recognizes them and direct play
* fails with `ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED`. Leaving them out
* makes the server remux these files for playback and for single-title and
* season downloads. A whole-series download at Original quality still fetches
* the original bytes, because the server does not check device capabilities
* for that batch. Add them back only once Media3 supports 192-byte packets
* and a device test passes.
*/
val media3OriginalVideoContainers: List<String> =
listOf(
"mp4", "m4v", "mov", "qt",
"webm", "mkv", "matroska", "avi",
"ts", "mpegts", "mpeg-ts", "m2ts", "mts",
"ts", "mpegts", "mpeg-ts",
)

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
package org.siloserver.silo.common.player.video

import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue

class PlaybackContainerPolicyTest {
@Test
fun media3ContainersIncludeValidatedOriginalFormats() {
listOf(
"mkv", "matroska", "mp4", "m4v", "webm", "avi", "mov", "qt", "ts", "mpegts", "mpeg-ts", "m2ts", "mts",
"mkv", "matroska", "mp4", "m4v", "webm", "avi", "mov", "qt", "ts", "mpegts", "mpeg-ts",
)
.forEach { container ->
assertTrue(normalizedPlaybackContainer(container) in media3OriginalPlaybackContainers, "container=$container")
}
}

@Test
fun media3ContainersExcludeBdavTransportStreams() {
// Media3's TsExtractor reads 188-byte packets only; Blu-ray/AVCHD
// m2ts/mts use 192-byte packets and must be remuxed by the server.
listOf("m2ts", "mts", ".M2TS", " MTS ")
.forEach { container ->
assertFalse(normalizedPlaybackContainer(container) in media3OriginalPlaybackContainers, "container=$container")
}
}
}
3 changes: 2 additions & 1 deletion docs/playback/02-migration-compatibility-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ least:
| Fixture | Required observation |
| --- | --- |
| H.264/HEVC SDR in MP4, MKV, and AVI | Direct play only for extractor/codec/seek combinations that pass; otherwise declared adaptation. |
| MOV/QT and TS/M2TS | Test direct, seeking, tracks, subtitles, and recovery; do not force remux solely from the extension. |
| MOV/QT and TS | Test direct, seeking, tracks, subtitles, and recovery; do not force remux solely from the extension. |
| M2TS/MTS (BDAV, 192-byte packets) | Expect server adaptation (remux), not direct play: Media3 cannot read 192-byte packets, so the client does not claim these containers. Test seeking, tracks, subtitles, and recovery on the adapted stream. |
| HDR10, HDR10+, and HLG | A claimed HDR output requires correct planned delivery plus display/TV evidence, including after server adaptation. Without external evidence, record only planned/effective range. |
| DV P5, P7 MEL, P7 FEL, and every P8 variant advertised by the server | The fixture manifest enumerates each claimed variant; initially include P8.1, P8.2, and P8.4 if advertised. Test decoder, plan, display mode, and visible output separately. Unsupported cases use a validated server transformation or `adaptation_unavailable`. |
| E-AC-3/JOC, TrueHD/Atmos, DTS-HD, AC-3, and AAC | Pass when an advertised encoding/layout produces AVR-confirmed bitstream; otherwise the plan must declare PCM or server adaptation with no unclassified failure. |
Expand Down
Loading