mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.74k stars 2.93k forks source link

vo/lavc youtube encoding failed when --start specified #14091

Open witaway opened 6 months ago

witaway commented 6 months ago

Important Information

Reproduction steps

I tried to download a part of youtube video and convert it into webp (so I could get a little snapshot for Anki). After a little research I found out that command causing the problem is:

mpv 'https://www.youtube.com/watch?v=Pv0iVoSZzN8' --start=100.875 --end=103.632 --loop-file=no --keep-open=no --ovc=libwebp --of=webp --ofopts-add=loop=0 --audio=no --no-sub --no-ocopy-metadata --ovcopts-add=lossless=0 --ovcopts-add=compression_level=6 --ovcopts-add=quality=25 --vf-add=scale=-2:200:flags=lanczos --vf-add=fps=10 -o='/home/witaway/Downloads/video123.webp'

It feels like ytdl cannot download the video in the case, but I'm not really sure :/

Logs (set --log-file=/dev/stdout):

io mpv Mpv mpv https.txt

lcksk commented 6 months ago

This is actually a known issue in ffmpeg, and you can find a solution here.

witaway commented 6 months ago

@lcksk Big thank you! I guessed it wasn't the MPV.

Do I understand correctly that in order for this functionality to start working in MPV, I need to patch Ffmpeg in my system?

It looks confusing that the Issue has not been fixed, although it is 6 years old and there are proposed patches

lcksk commented 6 months ago

@lcksk Big thank you! I guessed it wasn't the MPV.

Do I understand correctly that in order for this functionality to start working in MPV, I need to patch Ffmpeg in my system?

yeah It looks confusing that the Issue has not been fixed, although it is 6 years old and there are proposed patches

The patch might need to be rebased, but the good news is that it does indeed resolve the current issue.I suspect that the issue might be unresolved because the patch author might have left, hence the bug remains pending.

witaway commented 6 months ago

@lcksk May it be reasonable to add a short note in MPV docs --start section about the Issue? Buggy ffmpeg version and link to Issue/Patch (without any warranties)

It'd resolve some false expectations and prevent appearing new same issues here, because looks like bug is common enough