Skip to content

How to use the split_video_ffmpeg method for the third audio track? #271

Description

@yujimori1967github

I want to split a file in Video OBject file format into multiple files using the split_video_ffmpeg method. There are three audio tracks in the Video OBject file format, but when you actually divide them, only the first one is the target.

The question is, is there a way to split the third part of the audio track as audio?

Activity

  1. Breakthrough commented on Jun 5, 2022

    @Breakthrough
    Owner

    Try adding -map 0 to the arg_override parameter to include all tracks, e.g.:

    split_video_ffmpeg(
        "video.mp4",
        scene_list,
        arg_override='-map 0 -c:v libx264 -preset fast -crf 21 -c:a aac',
    )
    

    Supplying -map 0 will select all tracks (including video/audio/subtitles) which is probably what most people will want, so if that works out I'll look into setting that as the default for the next release.

    If you only want the third audio track, instead of -map 0, specify -map 0:a:2. See the ffmpeg docs for a full description of the -map argument.

    Can you let me know if that works out well for you, and if you think -map 0 is a good default? Thanks!

  2. added this to the v0.6.1 milestone on Jun 9, 2022
  3. Breakthrough commented on Jul 11, 2022

    @Breakthrough
    Owner

    I've verified that this seems to work acceptably for a variety of different inputs, so this is likely a reasonable default. Subtitle tracks still won't work with this, but they're ignored as-is so this change won't affect that either (-sn is defined for all ffmpeg commands by default).

  4. Breakthrough commented on Jul 13, 2022

    @Breakthrough
    Owner

    Added -map 0 to default ffmpeg args, will be included in v0.6.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions