Muxing Tracks

Yukine allows you to mux in any amount of audio and subtitle tracks from an existing video, or subtitle file. For this, we won’t do anything special like Matches.

Muxing all audio and subtitle tracks

In this example, we will mux in all audio and subtitle tracks from the video file.

Muxing all audio and subtitle tracks
vid1 = Source(
    video_input="video.mkv",
    audio=[
        SetAudioTrack(
            file="video.mkv",
            encoder=AudioEncoder.OPUS,
        )
    ],
    subs=[
        SetSubtitleTrack(
            file="video.mkv"
        )
    ],
)

Muxing specific audio and subtitle tracks

In this example, we will mux in the first audio and subtitle track from the video file.

Muxing specific audio and subtitle tracks
vid1 = Source(
    video_input="video.mkv",
    audio=[
        SetAudioTrack(
            file="video.mkv",
            track=0,
            encoder=AudioEncoder.OPUS,
        ),
    ],
    subs=[
        SetSubtitleTrack(
            file="video.mkv",
            track=0,
        ),
    ],
)

See? It’s that shrimple.

Muxing .ass subtitle files

In this example, we will mux in a .ass subtitle file.

Muxing .ass subtitle files
vid1 = Source(
    video_input="video.mkv",
    audio=[
        SetAudioTrack(
            file="video.mkv",
            encoder=AudioEncoder.OPUS,
        ),
    ],
    subs=[
        SetSubtitleTrack(
            file="subs.ass",
        ),
    ],
)