Unable to set --merge-output-format
AyoKeito opened this issue · 10 comments
What is your operating system (Windows, Linux, OSX, etc.)?
Ubuntu 21.10
What is your web server (Apache, IIS, etc.)?
nginx/1.21.5
What version of AllTube are you using?
Master branch
How did you install AllTube (with Git or with a release package)?
Git clone + composer
What version of PHP are you using?
PHP 7.4.27 (cli)
What version of Python are you using?
Python 2.7.18 for youtube-dl or Python 3.9.7 for yt-dlp
What version of youtube-dl are you using?
Included
Do you get any PHP-related errors in your webserver's logs?
No.
What is the content of your config/config.yml
file?
---
# Path to your youtube-dl binary
#youtubedl: vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py
youtubedl: vendor/yt-dlp/yt_dlp/__main__.py
# Path to your python binary
#python: /usr/bin/python
python: /usr/bin/python3
# An array of parameters to pass to youtube-dl
params:
- --no-warnings
- --ignore-errors
- --flat-playlist
- --restrict-filenames
- --no-playlist
- --merge-output-format
- mp4
# True to enable audio conversion
convert: false
# True to enable advanced conversion mode
convertAdvanced: false
# List of formats available in advanced conversion mode
convertAdvancedFormats: [mp3, avi, flv, wav]
# Path to your ffmpeg binary
ffmpeg: /usr/bin/ffmpeg
# ffmpeg logging level.
ffmpegVerbosity: error
# Path to the directory that contains the phantomjs binary.
phantomjsDir: /usr/bin/
# True to disable URL rewriting
uglyUrls: false
# True to stream videos through server
# Set to "ask" if you want to allow it but not enable by default.
stream: true
# True to enable remux mode (merge best audio and best video)
remux: true
# MP3 bitrate when converting (in kbit/s)
audioBitrate: 128
# App name
appName: AllTube Download
# Generic formats supported by youtube-dl
genericFormats:
best/bestvideo: Best
bestvideo+bestaudio: Remux best video with best audio
worst/worstvideo: Worst
# Enable debug mode.
debug: false
# True to enable audio conversion mode by default
defaultAudio: false
# False to disable convert seek functionality
convertSeek: true
Please provide the URL of a video that causes the issue.
Any.
https://www.youtube.com/watch?v=5oxDwxkOAXI
I'm trying to set --merge-output-format mp4
in config, but get an error:
'/usr/bin/python' 'vendor/ytdl-org/youtube-dl/youtube_dl/main.py' '--no-warnings' '--ignore-errors' '--flat-playlist' '--restrict-filenames' '--no-playlist' '--merge-output-format mp4' '--dump-single-json' 'https://www.youtube.com/watch?v=5oxDwxkOAXI' '-f' 'best/bestvideo' failed with this error:
Usage: main.py [OPTIONS] URL [URL...]
main.py: error: no such option: --merge-output-format mp4
How can i fix this? Do i need to modify any other sources to make remux
produce mp4 files instead of mkv's?
Trying with installation from GIT or in Docker, with youtube-dl
or yt-dlp
- everything returns the same error.
Please don't remove the issue template.
I assume you are doing this:
params:
- --merge-output-format mp4
The correct syntax is this:
params:
- --merge-output-format
- mp4
Sorry. I've edited the template back.
That fixed the error i was getting but alltube still offers mkv file as a result, despite merge-output-format
set to mp4
.
Is it possible to make remux output files in mp4 container? Or should i make another issue for that question?
The remux format is hardcoded here.
I suppose we could add an option to allow changing the format.
However, very few formats support muxing streams and MP4 is not one of them:
[mp4 @ 0x559e6d37d940] muxer does not support non seekable output
Oh, i see.
Could -movflags frag_keyframe+empty_moov
help with the problem?
It seems that it can make the resulting file incompatible with some software, but it would produce a file usable in Premiere Pro (i've just checked) that does not support mkv.
We do use that for M3U streams so I guess it could work.
Should i try changing the hardcoded matroska and adding -movflags frag_keyframe+empty_moov
to see if it helps, or are there more variables in play, apart from one linked above?
UP: nevermind, it's not a class git can clone anyway.
You will also need to change the MIME type here:
And the file extension here:
If i put modified Downloader.php into alltube classes folder, will it work?
You will need to edit it in vendor/rudloff/alltube-library/classes/Downloader.php
.
Thank you!
It worked!
I've also had to edit genericFormats
section in config
to make it download video and audio streams compatible with mp4 container:
bestvideo[ext=mp4]+bestaudio[ext=m4a]: Remux best video with best audio
I'm now getting a proper mix of 1080P video and m4a audio using the remux option.
And for my fellow Adobe Premiere enthusiasts, the better option is
bestvideo*[height<=1080][vcodec^=avc1]+bestaudio[ext=m4a]: Remux best video with best audio
...because Premiere Pro is not working with av1 as of today.