Skip to content
TheChatArchiveThe Chat Archive
Metallama-4-maverick-17b-128e-instruct· MetaHugging Face LMArena Human Preference 140K

I have a h265/flac inside an mkv container (with ass subtitles). Can I serve this as…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with chatgpt-4o-latest-20250326’s answer.
  1. User

    I have a h265/flac inside an mkv container (with ass subtitles). Can I serve this as dash without reencoding?

  2. Meta Assistant

    You can serve your H.265 video and FLAC audio as DASH without re-encoding, but there are a few considerations:

    1. H.265 (HEVC) video: Supported by the DASH standard. However, not all devices or browsers support H.265 playback. Make sure your target clients (e.g., browsers, players) support H.265 decoding.

    2. FLAC audio: While FLAC is a great lossless codec, its support in DASH is not as widespread as AAC or other lossy codecs. Some DASH players or devices might not support FLAC.

    To create a DASH stream without re-encoding, you can use the following command:

    ffmpeg -i input.mkv \
           -c copy \
           -map 0:v \
           -map 0:a \
           -f dash \
           -seg_duration 2 \
           -frag_duration 1 \
           output.mpd
    

    This command will copy the H.265 video and FLAC audio streams into DASH segments. Note that subtitles (ASS in your case) are not directly supported in DASH; you might need to convert them to a supported format like TTML or WebVTT, or use a different method to deliver subtitles.

    Keep in mind that client support is crucial. If your target clients don't support H.265 or FLAC, you might need to re-encode or provide alternative streams.

  3. User

    Are there any codec-agnostic alternatives to dash?

  4. Meta Assistant

    Yes, there are codec-agnostic alternatives to DASH. Some of them are:

    1. CMAF (Common Media Application Format): CMAF is a container format that can be used for both HLS (HTTP Live Streaming) and DASH. It allows for a single set of media segments to be used for multiple streaming protocols, making it codec-agnostic. CMAF is supported by many modern players and devices.

    2. Low-Latency HLS (LL-HLS): While HLS is typically associated with specific codecs (e.g., H.264 and AAC), LL-HLS is designed to be more flexible and can be used with various codecs. LL-HLS is a variant of HLS that reduces latency.

    Both CMAF and LL-HLS can be used with a variety of codecs, including H.264, H.265, VP9, AV1, AAC, AC-3, E-AC-3, and others.

    To create CMAF or LL-HLS streams with ffmpeg, you can use the following commands:

    # CMAF (for DASH and HLS)
    ffmpeg -i input.mkv \
           -c:v libx264 \
           -c:a aac \
           -f hls \
           -hls_segment_type fmp4 \
           output.m3u8
    
    # or for DASH
    ffmpeg -i input.mkv \
           -c copy \
           -f dash \
           -seg_duration 2 \
           -frag_duration 1 \
           -use_template 1 \
           -use_timeline 1 \
           -init_seg_name init-\$RepresentationID\$.\$ext\$ \
           -media_seg_name chunk-\$RepresentationID\$-\$Number%05d\$.\$ext\$ \
           output.mpd
    
    # LL-HLS
    ffmpeg -i input.mkv \
           -c:v libx264 \
           -c:a aac \
           -f hls \
           -hls_playlist_type event \
           -hls_time 1 \
           -hls_flags single_file+discont_start+omit_endlist \
           output.m3u8
    

    Keep in mind that client support is still crucial, and not all devices or players may support CMAF or LL-HLS.

  5. User

    "Unlike HDS, or Smooth Streaming, DASH is codec-agnostic, which means it can use content encoded with any coding format, such as H.265, H.264, VP9, etc.[9]"

  6. Meta Assistant

    DASH (Dynamic Adaptive Streaming over HTTP) is indeed codec-agnostic by design. This means that it can be used with a wide range of codecs, including H.264, H.265, VP9, AV1, and others, without requiring a specific codec.

    The DASH specification focuses on the packaging and delivery of media content, rather than the encoding or decoding of the content itself. As a result, DASH can be used with various codecs, making it a versatile and flexible streaming solution.

    So, to answer your original question, DASH is already a codec-agnostic alternative, and you can use it with your H.265 and FLAC streams without needing to switch to a different streaming protocol.

  7. User

    How difficult would it be to build something similar to dash that was based on mkv, so I could serve whatever codecs I wanted?

  8. Meta Assistant

    Building a streaming protocol similar to DASH, but based on MKV, is theoretically possible. However, it would require significant development and might not be as straightforward as it seems. Here are some challenges to consider:

    1. MKV is a container format, not a streaming protocol: MKV is a container format designed for storing multimedia content, not for streaming. While it's possible to use MKV as a basis for a streaming protocol, you'd need to define how to segment the content, handle seeking, and manage metadata.

    2. Segmentation and chunking: DASH and other streaming protocols use a segmentation approach, where the content is divided into smaller, independent chunks. MKV doesn't have a built-in segmentation mechanism, so you'd need to define how to split the content into manageable pieces.

    3. Metadata and manifest: DASH uses an MPD (Media Presentation Description) manifest file to describe the available content, codecs, and other metadata. You'd need to create a similar metadata structure for your MKV-based protocol.

    4. Seeking and random access: MKV has a complex indexing system, which can make it challenging to implement efficient seeking and random access. You'd need to develop a strategy for handling these operations.

    5. Client support: One of the significant advantages of DASH is its widespread adoption and support across various clients and devices. Building a new protocol based on MKV would require developing client-side support, which can be a significant undertaking.

    6. Interoperability and compatibility: Ensuring interoperability between different implementations of your MKV-based protocol could be challenging. You'd need to define a clear specification and ensure that different clients and servers can work together seamlessly.

    If you're still interested in pursuing this idea, you could start by:

    1. Defining the protocol specification: Outline the key components, such as segmentation, metadata, and seeking mechanisms.
    2. Developing a proof-of-concept implementation: Create a basic implementation to test the feasibility of your idea.
    3. Evaluating existing technologies: Research existing technologies, such as Matroska Live, which is a live streaming format based on MKV.

    Keep in mind that building a new streaming protocol is a complex task that requires significant expertise and resources. You might want to consider using existing protocols like DASH or exploring other alternatives before investing in a custom solution.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.