kkdai / youtube

Download Youtube Video in Golang
MIT License
3.3k stars 430 forks source link

Video plays but no audio #309

Open atljoseph opened 10 months ago

atljoseph commented 10 months ago

On Mac. Installed with brew.

yangxuhui commented 10 months ago

Can you please provide more details about how you download video ?

DEfusion commented 9 months ago

For me if I set -q '' to get best quality I have no audio, if I don't then I get audio.

When I pass -q '' codecs I get this info:

quality=hd1080 mimeType="video/mp4; codecs="avc1.64002a"

When I don't I get this info, so seems it's not getting the audio stream when hd1080

quality=medium mimeType="video/mp4; codecs="avc1.42001E, mp4a.40.2"
DEfusion commented 9 months ago

Related to https://github.com/kkdai/youtube/issues/273

For now I'm downloading 2 videos and combining the audio with ffmpeg as a hack, I only have a few to download so that's fine for me.

Eric-lab-star commented 8 months ago

I encountered same issued but solved by running command with the tag that has both audio and video.

For example, url of video you want to download is https://www.youtube.com/watch?v=5JberwYl-Zo

  1. Run, youtubedr info https://www.youtube.com/watch?v=5JberwYl-Zo you can see ITAG 22 has both video and audio
  2. Run youtubedr download -q 22 https://www.youtube.com/watch?v=5JberwYl-Zo -o happydog.mp4 pass ITAG 22 to -q flag so you can download video and audio
  3. open happydog.mp4 file