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

video fine but no sound ... #26225

Closed
Albretch opened this issue Aug 3, 2020 · 5 comments
Closed

video fine but no sound ... #26225

Albretch opened this issue Aug 3, 2020 · 5 comments

Comments

@Albretch
Copy link

@Albretch Albretch commented Aug 3, 2020

Checklist

  • [x ] I'm asking a question
  • [ x] I've looked through the README and FAQ for similar questions
  • [ x] I've searched the bugtracker for similar questions including closed ones

Question

WRITE QUESTION HERE

I think the IT people at work are messing with my silly youtube-dl script:

time(python ./youtube-dl --user-agent "${_RNDM_UA}" --no-progress --no-call-home --continue --ignore-errors --no-overwrites --format "bestvideo[ext=mp4]/best" --write-auto-sub --write-sub --sub-lang "${_Ls}" --write-info-json --output "${_ODIR}/%(uploader)s/%(id)s.%(ext)s" "${_YT_URI}") >> "${_LOG_FL}" 2>&1

the only minimally fancy thing in that one liner is that I am randomly timing the hits and randomly setting user agent from defined ones in order to tickle youtube a bit.

Vidoes are fine but without audio.

What I see when I try to watch the videos using vlc ist:

[00007f2154c17ac8] core demux error: option sub-original-fps does not exist
[00007f2154c1b338] core demux error: option sub-original-fps does not exist
[00007f2154c1f3b8] core demux error: option sub-original-fps does not exist

I think what they are doing on the proxy is messing with the connection when the browser user agent doesn't match the one installed on the laptops at work, but they could have gone way more sophiticated than that since they own and monitor those laptops 24x7

How would be the script to download just the audio and merge it to the corresponding video, probably even offline? (I mostly use Debian Linux)

Would renaming all downloaded media files as ".mp4.part" and starting the download again to complete the audio track work?

Any suggestions?

lbrtchx

@Albretch Albretch added the question label Aug 3, 2020
@s104346
Copy link

@s104346 s104346 commented Aug 3, 2020

--format "bestvideo[ext=mp4]/best" will only download the best video-only stream, but no audio stream. You should use something like
--format "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" instead (taken from https://github.com/ytdl-org/youtube-dl#format-selection-examples)

@Albretch
Copy link
Author

@Albretch Albretch commented Aug 4, 2020

but, as you suggest, if I use:

--format "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best"

youtube-dl will download two separate files which you may not be able to merge if you run youtube-dl in a Linux machine at work which you can't change, to which you have to admin access to.

So, what should I do? How can I append to audio to the already downloaded videos?

Thank you

@Albretch
Copy link
Author

@Albretch Albretch commented Aug 6, 2020

OK, I tried the --format setting you suggested on a Windows box and got two files to be then merged. Exactly the problem I am trying to avoid!

...>youtube-dl.exe --user-agent "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0" --no-progress --no-call-home --continue --ignore-errors --no-overwrites --format "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" --write-auto-sub --write-sub --sub-lang "de,de,es" --write-info-json --output "%(uploader)s%(id)s.%(ext)s" "Ecd4M9GdGQU"
[youtube] Ecd4M9GdGQU: Downloading webpage
[youtube] Ecd4M9GdGQU: Downloading js player e49bfb00
[youtube] Ecd4M9GdGQU: Downloading js player e49bfb00
WARNING: video doesn't have subtitles
[youtube] Ecd4M9GdGQU: Looking for automatic captions
WARNING: Couldn't find automatic captions for Ecd4M9GdGQU
[youtube] Ecd4M9GdGQU: Downloading MPD manifest
[info] Writing video description metadata as JSON to: ...\Dawid Pisko\Ecd4M9GdGQU.info.json
WARNING: You have requested multiple formats but ffmpeg or avconv are not installed. The formats won't be merged.
[dashsegments] Total fragments: 144
[download] Destination: ...\Dawid Pisko\Ecd4M9GdGQU.f137.mp4
[download] Download completed
[dashsegments] Total fragments: 183
[download] Destination: ...\Dawid Pisko\Ecd4M9GdGQU.f140.m4a
[download] Download completed

...>dir "...\Dawid Pisko"
Volume in drive C has no label.
Volume Serial Number is 3EB7-0F25

Directory of Dawid Pisko

08/05/2020 12:39 PM

.
08/05/2020 12:39 PM ..
08/05/2020 12:36 PM 57,423,941 Ecd4M9GdGQU.f137.mp4
08/05/2020 12:39 PM 14,422,743 Ecd4M9GdGQU.f140.m4a
08/05/2020 12:35 PM 158,508 Ecd4M9GdGQU.info.json
3 File(s) 72,005,192 bytes
2 Dir(s) 169,623,977,984 bytes free

...>

Again, at times I have to work on machines on which I can't install ffmpeg or avconv. So, my questions are still open.

  1. How can I download the best mp4 formated videos with the best audio to that video at once. No merging necessary.

  2. If I find a video without its corresponging audio. How can youtube-dl "continue" the download and then automatically merge the audio? Is that possible?

thanks,
lbrtchx

@RandomContributor
Copy link

@RandomContributor RandomContributor commented Aug 6, 2020

build ffmpeg statically and get the binaries on your work pc, then use --ffmpeg-path .. You can download a mp4 container with both video and audio using 'best'. Note that that is usually H.264 encoded, thus has lower quality than the VP9 encodes. I suggest you use VP9 x Opus for better quality, like so: 'bestvideo[vcodec=vp9]+bestaudio[acodec=opus]/best' .

@lengland
Copy link

@lengland lengland commented Aug 7, 2020

If your machine allows you to use Docker, there is a container for ffmpeg that I use at home.
This will allow you to run the merge outside of youtube-dl, and still produce the same result

@dstftw dstftw closed this Aug 7, 2020
@dstftw dstftw added the incomplete label Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.