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
No audio while streaming YouTube videos #4253
Comments
Apparently changes in the latest version of Busy today. Will take a closer look at this soon. |
WorkaroundThe mpv project has updated the Lua script ytdl_hook.lua to be compatible with the latest version of From the mpv manual section Script location:
I decided to use the scripts directory. To create that directory and download the fixed version of the script from the mpv master branch I copied these commands into Terminal: mkdir -p ~/.config/mpv/scripts/
(cd ~/.config/mpv/scripts/ && curl --location --remote-header-name --remote-name https://raw.githubusercontent.com/mpv-player/mpv/master/player/lua/ytdl_hook.lua) This is what it looks like running the commands: low-batt@gag ~$ mkdir -p ~/.config/mpv/scripts/
low-batt@gag ~$ (cd ~/.config/mpv/scripts/ && curl --location --remote-header-name --remote-name https://raw.githubusercontent.com/mpv-player/mpv/master/player/lua/ytdl_hook.lua)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 34829 100 34829 0 0 11981 0 0:00:02 0:00:02 --:--:-- 11997
low-batt@gag ~$ After running those commands I have a copy of the updated script in the default scripts directory used by mpv: low-batt@gag ~$ ls -l ~/.config/mpv/scripts/
total 72
-rw-r--r-- 1 low-batt staff 34829 Mar 8 10:35 ytdl_hook.lua
low-batt@gag ~$ The second part of the workaround is to configure IINA/mpv to use the scripts directory and to not use the embedded script. To do that follow these instructions:
Remember to remove this workaround once a version of IINA is released that contains a fix for this issue. With this workaround in place I am able to successfully stream the two above mentioned YouTube videos using IINA 1.3.1 with If the workaround is correctly applied the
|
Thanks for the workaround. The workaround works, but it takes like a minute for the video to show up for me. |
I have the IINA setting |
Yeah, I'm not sure what's wrong. Here's the screen recording of the example video. It took almost 3 minutes for that specific video. record.mp4 |
@along02 I watched the video. Bummer. I tried playing The World in HDR in 4K (ULTRA HD) myself again to make sure YouTube had not just changed something. It started playing for me after maybe 10 seconds, not 3 minutes. If you run low-batt@gag issue-4253$ yt-dlp https://www.youtube.com/watch?v=tO01J-M3g0U
[youtube] Extracting URL: https://www.youtube.com/watch?v=tO01J-M3g0U
[youtube] tO01J-M3g0U: Downloading webpage
[youtube] tO01J-M3g0U: Downloading android player API JSON
[info] tO01J-M3g0U: Downloading 1 format(s): 337+251
[dashsegments] Total fragments: 53
[download] Destination: The World in HDR in 4K (ULTRA HD) [tO01J-M3g0U].f337.webm
[download] 9.6% of ~ 530.00MiB at 5.79MiB/s ETA 00:43 (frag 5/53)^C
ERROR: Interrupted by user
low-batt@gag issue-4253$ If the download speed is really slow then investigate if your ISP is known to throttle downloads. If the test shows a reasonable speed then we should look into the mpv log file and see if that provides any clue as to what is happening. Logging is disabled by default. To enabled logging follow these instructions:
Once IINA has restarted, stream the video and reproduce the problem. Then:
The The log files can also be accessed using Terminal as shown here: low-batt@gag com.colliderli.iina$ pwd
/Users/low-batt/Library/Logs/com.colliderli.iina
low-batt@gag com.colliderli.iina$ ls
2022-10-04-17-57-15_jVrbWy
low-batt@gag com.colliderli.iina$ cd 2022-10-04-17-57-15_jVrbWy
low-batt@gag 2022-10-04-17-57-15_jVrbWy$ ls
iina.log mpv.log
low-batt@gag 2022-10-04-17-57-15_jVrbWy$ With logging enabled IINA creates a new log directory each time it is started. If accessing the logs using DO NOT FORGET to disable logging once you have obtained log files for the problem being investigated. IINA does not restrict the size of log files or delete old logs. If you leave logging enabled the logs will continue to accumulate. |
Thanks for the tips! It turned out that yt-dlp was also bugging out (not downloading) when I tried to just normally use it on Terminal. I just restarted my computer and it seems to be doing fine now (downloading at 3 Mib/s) on Terminal and on IINA. |
Really glad it is now working properly for you. Really disturbing that rebooting fixed the issue. I noticed you have a M1 Mac, so the hardware should not have any trouble handling that 4K video. How much memory? Which version of macOS? It used to be that if something was leaking memory and had grown too large it could slow down the machine. Rebooting would fix that problem. But with the high speed of solid state disks macOS is really good at swapping memory. Using up all of the physical memory does not slow down the Mac like it used to. It used to be that if something was looping and consuming all of the CPU it could slow down the machine. Rebooting would sometimes fix that problem. But with the many CPU cores in the M1 a looping application can take up one of the cores and have nearly no effect on performance. Maybe something got corrupted in the WiFi system? I would bring up Console and check crash reports to see if macOS background daemons are crashing and restarting. I'd also keep an eye on the system using Activity Monitor. |
I have 16 GB of memory and am on Ventura 13.2.1. Also, it wasn't just specifically the 4k video. It was any YouTube video that I put into IINA (and probably yt-dlp as well) took a really long time to load. I also noticed that updating python pip packages the past few days took noticeably longer as well so maybe it was something WiFi related. I checked the Console and didn't find anything weird. I'll keep on eye if it happens again. |
Ventura 13.2.1 definitely still contains regressions related to graphics that were not present in Monterey. I'm hoping for an update from Apple that fixes them. Without adding new ones. Seems other areas of macOS Venturna may need some fixing as well… |
I have confirmed the mpv library in the updated dependencies has been correctly patched with the new Lua script and can stream the videos listed in the issue without error. This issue will be fixed in the next release of IINA. The workaround will no longer be needed. |
This issue has been fixed in IINA 1.3.2. If you applied the workaround involving the |
System and IINA version:
Expected behavior:
IINA can play YouTube videos.
Actual behavior:
After upgrading to
yt-dlp
v2023.03.04 (latest release at this time) the video The World in HDR in 4K (ULTRA HD) plays without any audio. Attempting to play the video Wearing This While Working Will Get You Killed fails, displaying this error:IINA was working correctly using the previous release of
yt-dlp
, v2023.02.17.This is what the IINA log shows when attempting to play the second video where neither video or audio streams are found.
IINA log:
Steps to reproduce:
Play the above referenced YouTube videos.
This is a problem for mpv as well.
How often does this happen?
Every time.
The text was updated successfully, but these errors were encountered: