Rudloff / alltube

Web GUI for youtube-dl
GNU General Public License v3.0
2.96k stars 582 forks source link

Remux mode cut a part of the audio track #325

Open stemy2 opened 3 years ago

stemy2 commented 3 years ago

New issue Your environment

Please answer these questions when reporting a new issue:

What is your operating system (Windows, Linux, OSX, etc.)? Linux What is your web server (Apache, IIS, etc.)? NGINX What version of AllTube are you using? 2.3.0 How did you install AllTube (with Git or with a release package)? Yunohost package What version of PHP are you using? 7.3 What version of Python are you using? 2.7.16 What version of youtube-dl are you using? Don't know 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

# Path to your python binary
python: /usr/bin/python

# An array of parameters to pass to youtube-dl
params:
    - --no-warnings
    - --ignore-errors
    - --flat-playlist
    - --restrict-filenames
    - --no-playlist

# True to enable audio conversion
convert: true

# True to enable advanced conversion mode
convertAdvanced: true

# List of formats available in advanced conversion mode
convertAdvancedFormats: [mp3, avi, flv, wav]

# Path to your avconv or ffmpeg binary
avconv: /usr/bin/ffmpeg

# avconv/ffmpeg logging level.
avconvVerbosity: error

# Path to the directory that contains the phantomjs binary.
phantomjsDir: vendor/bin/

# True to disable URL rewriting
uglyUrls: false

# True to stream videos through server
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

Please provide the URL of a video that causes the issue. https://youtu.be/a-bvPLbeRHE Describe your issue

With remux mode, a part of the audio track is wiped, making it shorter than the video track, so the last seconds of the video are muted.

Rudloff commented 3 years ago

I can reproduce the issue but I am not sure what happens. ffmpeg seems to remux correctly:

frame= 7226 fps= 55 q=-1.0 Lsize=   54905kB time=00:04:48.96 bitrate=1556.5kbits/s speed=2.19x    
video:50832kB audio:3914kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.289399%
Input file #0 (https://r4---sn-25glene6.googlevideo.com/videoplayback?expire=1610762861&ei=DfYBYLPFCI23xN8P2PGy6AI&ip=2a01%3Acb0c%3A35%3Ac200%3A5d1b%3Aee69%3A12c8%3A93ff&id=o-AEbfldrGdFszBFpSCKFv7N02DMcytsCkYE7GqWWGKnE0&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278%2C394%2C395%2C396%2C397%2C398%2C399&source=youtube&requiressl=yes&mh=Uc&mm=31%2C29&mn=sn-25glene6%2Csn-25ge7nsl&ms=au%2Crdu&mv=m&mvi=4&pl=30&initcwndbps=1045000&vprv=1&mime=video%2Fmp4&ns=FACQ6J_w0Q6iBoLy8FUDJXIF&gir=yes&clen=52146476&dur=289.040&lmt=1604082236186411&mt=1610740646&fvip=4&keepalive=yes&c=WEB&txp=5535432&n=Ol9JmMou5tvIsA&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgBYnVs-XozfLkv-wnU_RKo3YhXPx3Y9iOb8M9YZATvdcCIQC8Wdqgf45FhYs1U-IGkbS6Nv6SW-iU_v6R_SfN5rqzZQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgQTqgZhiB2t3l1LKluXfIyMxxO3zM7nMBU7NsOIYPuAACIFDT-Ef29mdXqEPA6R5UOL7Wgq_hAARthQnR9m-tBL0Z&ratebypass=yes):
  Input stream #0:0 (video): 7226 packets read (52052384 bytes); 
  Total: 7226 packets (52052384 bytes) demuxed
Input file #1 (https://r4---sn-25glene6.googlevideo.com/videoplayback?expire=1610762861&ei=DfYBYLPFCI23xN8P2PGy6AI&ip=2a01%3Acb0c%3A35%3Ac200%3A5d1b%3Aee69%3A12c8%3A93ff&id=o-AEbfldrGdFszBFpSCKFv7N02DMcytsCkYE7GqWWGKnE0&itag=251&source=youtube&requiressl=yes&mh=Uc&mm=31%2C29&mn=sn-25glene6%2Csn-25ge7nsl&ms=au%2Crdu&mv=m&mvi=4&pl=30&initcwndbps=1045000&vprv=1&mime=audio%2Fwebm&ns=FACQ6J_w0Q6iBoLy8FUDJXIF&gir=yes&clen=4717660&dur=289.061&lmt=1604081493025803&mt=1610740646&fvip=4&keepalive=yes&c=WEB&txp=5531432&n=Ol9JmMou5tvIsA&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgFexreKU7-BAAeNzWknS85W2dnEjx18RqQRzc0gm_gsECIQDy1lb4btUVG2ZYVhmLBjx1Q--_cI6ucLGLpRm-vw8Y0A%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgQTqgZhiB2t3l1LKluXfIyMxxO3zM7nMBU7NsOIYPuAACIFDT-Ef29mdXqEPA6R5UOL7Wgq_hAARthQnR9m-tBL0Z&ratebypass=yes):
  Input stream #1:0 (audio): 12424 packets read (4007885 bytes); 
  Total: 12424 packets (4007885 bytes) demuxed
Output file #0 (pipe:1):
  Output stream #0:0 (video): 7226 packets muxed (52052384 bytes); 
  Output stream #0:1 (audio): 12424 packets muxed (4007885 bytes); 
  Total: 19650 packets (56060269 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x5576a26f9440] Statistics: 0 seeks, 2777 writeouts
[AVIOContext @ 0x5576a26b9900] Statistics: 52146476 bytes read, 0 seeks
[AVIOContext @ 0x5576a29ffb00] Statistics: 4095984 bytes read, 0 seeks

I tried calling the same ffmpeg command in a terminal and it seems to happen only when it outputs to a pipe.

hhhkkk520 commented 3 years ago

What is your operating system (Windows, Linux, OSX, etc.)? Linux Centos 7.9 What is your web server (Apache, IIS, etc.)? NGINX What version of AllTube are you using? 3.0.0 beta 5 How did you install AllTube (with Git or with a release package)? Release package What version of PHP are you using? 7.2 What version of Python are you using? 2.7.5 What version of youtube-dl are you using? youtube-dl 2021.02.22 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

# Path to your python binary
python: /usr/bin/python

# An array of parameters to pass to youtube-dl
params:
    - --no-warnings
    - --ignore-errors
    - --flat-playlist
    - --restrict-filenames
    - --no-playlist

# True to enable audio conversion
convert: trun

# 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. All Youtube videos Describe your issue

I got the same issues, when i download the viedo with Remux from Youtube, the last one or two minutes of the video are muted.