Skip to content
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

How do I remux video to a different format Using the Python yt-dlp invocation? #9941

Closed
6 of 9 tasks
kylegustavo opened this issue May 17, 2024 · 1 comment
Closed
6 of 9 tasks
Labels
question Question

Comments

@kylegustavo
Copy link
Contributor

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Please make sure the question is worded well enough to be understood

I've been looking at the python version of the command at https://github.com/yt-dlp/yt-dlp/blob/9ebac35577e61c3d25fafc959655fa3ab04ca7ef/yt_dlp/YoutubeDL.py, and I noticed there isn't a "remux-video" option. Looking closer at the code, however, it appears there should be a way to remux or recode a video using the 'postprocessors' argument, but it isn't clear to me how this should be used. I've tried using [{"key": "FFmpegVideoConvertor", "when": "post_process"}] or [{"key": "FFmpegVideoRemuxer", "when": "post_process"}], with the extension in the final_ext argument, but there are some issues. Any guidance on what options I should use to get a remux or recode from mp4 to other formats in place of --remux-video in the command line version, like mov and avi?

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

No response

@kylegustavo kylegustavo added the question Question label May 17, 2024
@bashonly
Copy link
Member

use devscripts/cli_to_api.py

ydl_opts = {
    'final_ext': 'mp4',
    'postprocessors': [{
        'key': 'FFmpegVideoRemuxer',
        'preferedformat': 'mp4',
    }],
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question
Projects
None yet
Development

No branches or pull requests

2 participants