Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yujimori1967github opened this issue Jun 5, 2022 · 3 comments
Milestone

Comments

@yujimori1967github
Copy link

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?

@Breakthrough
Copy link
Owner

Breakthrough commented Jun 5, 2022

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!

@Breakthrough Breakthrough added this to the v0.6.1 milestone Jun 9, 2022
@Breakthrough
Copy link
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).

Breakthrough added a commit that referenced this issue Jul 13, 2022
This ensures multiple audio tracks are included by default. #271
@Breakthrough
Copy link
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
Projects
None yet
Development

No branches or pull requests

2 participants