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

[Bug] Downloads fail with "Force Keyframes At Cuts" #729

Open
2 tasks done
madmini opened this issue Feb 25, 2025 · 16 comments
Open
2 tasks done

[Bug] Downloads fail with "Force Keyframes At Cuts" #729

madmini opened this issue Feb 25, 2025 · 16 comments
Labels
bug Something isn't working yt-dlp related Not a bug about the app but with the yt-dlp library

Comments

@madmini
Copy link
Contributor

madmini commented Feb 25, 2025

  • Tried latest version

  • This issue is not duplicated with any other open or closed issues

Describe the bug

Downloads with cuts fail when Force Keyframes At Cuts is turned on.

Logs show ERROR: ffmpeg exited with code -4. The exact same downloads work when Force Keyframes At Cuts is turned off.

Expected behavior

Downloads with Force Keyframes At Cuts work normally.

Steps to reproduce

Select a video to download, add a cut and check Force Keyframes At Cuts then download.

Device information

Device: OnePlus 6
System: OxygenOS 11.1.2.2 (Android 11)

Screenshots / Recordings

No response

Additional context

log:

Downloading:
Title: The Last Photograph We Took Of Earth
URL: https://youtube.com/shorts/YKax1HA4vHg
Type: video
Command:
--extractor-args "youtube:lang=de" --newline -N "3" --trim-filenames "183" --no-mtime --sponsorblock-remove "music_offtopic" --force-keyframes-at-cuts --download-sections "*0:00-0:07" --sponsorblock-mark "all" --embed-chapters --merge-output-format "webm" -S "vcodec:av01,acodec:opus,vext:webm" -f "398+251/398+ba/398/b" --embed-subs --sub-format "srt/best" --convert-subtitles "srt" --sub-langs "en.*,.*-orig" -P "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/20" -o "%(autonumber)d. %(section_title&{} - |)s%(uploader).30B - %(title).170B [%(section_start>%H∶%M∶%S)s].%(ext)s" --replace-in-metadata "title" ".+" "The Last Photograph We Took Of Earth" --parse-metadata "%(title)s:%(meta_title)s" --replace-in-metadata "uploader" ".+" "Vsauce" --parse-metadata "%(uploader)s:%(artist)s" "https://youtube.com/shorts/YKax1HA4vHg" 

WARNING: [youtube] Preferring "de" translated fields. Note that some metadata extraction may fail or be incorrect.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://rr5---sn-4g5lznle.googlevideo.com/videoplayback?expire=1740496385&ei=oYm9Z7ayL7rGi9oP5-aF0AI&ip=80.109.227.63&id=o-AGEK41A5fcJyXtcmmFCxi-Rd-cLoDN3JJ0YxbZsKBk5g&itag=398&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C247%2C395%2C396%2C397%2C398%2C779%2C780%2C788&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1740474785%2C&mh=gV&mm=31%2C26&mn=sn-4g5lznle%2Csn-5hneknes&ms=au%2Conr&mv=m&mvi=5&pl=24&rms=au%2Cau&pcm2=no&initcwndbps=4411250&bui=AUWDL3wOnNED6gq99PgsLW_EHJ7HwdLIby3uavesBsnVP35kKaINeGLtY-cWnI74dLR7n-qi-jWGNgc_&spc=RjZbSVYzCQCxZ55MbJ2XswEO2sHOs2QkdOCOJ8IWxTikq_4zq1HCvHiZkvWdelDRg9N39Q&vprv=1&svpuc=1&mime=video%2Fmp4&ns=zCNpE3kwHOYMKv5lls7FkkUQ&rqh=1&gir=yes&clen=3330346&dur=59.993&lmt=1738308510662259&mt=1740474291&fvip=4&keepalive=yes&lmw=1&fexp=51326932&c=TVHTML5&sefc=1&txp=543C534&n=oKj9PwFmW1t96g&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgd09qZoDyULiHlw7c45iE8l570LWzblopOZ21gUkzsGICIQDpAvrF_gyoFtRquJ973JzSj58V5dxK4q1t4PiSwNfGkA%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhALF87TuAQxFBdir_A_phuOXRyN2avMVTHzBj6v4Gm13dAiEA3aABBcDmhc8MOTgf4aY5tLfAe7qUpeWFG2CB88xpFUk%3D':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6av01mp41
    creation_time   : 2025-01-31T07:14:46.000000Z
  Duration: 00:00:59.99, start: 0.000000, bitrate: 444 kb/s
  Stream #0:0[0x1](und): Video: av1 (libdav1d) (Main) (av01 / 0x31307661), yuv420p(tv, smpte170m/bt470bg/bt709), 720x1280, 63 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
      Metadata:
        creation_time   : 2025-01-31T07:14:46.000000Z
        handler_name    : ISO Media file produced by Google Inc.
        vendor_id       : [0][0][0][0]
Input #1, matroska,webm, from 'https://rr5---sn-4g5lznle.googlevideo.com/videoplayback?expire=1740496385&ei=oYm9Z7ayL7rGi9oP5-aF0AI&ip=80.109.227.63&id=o-AGEK41A5fcJyXtcmmFCxi-Rd-cLoDN3JJ0YxbZsKBk5g&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1740474785%2C&mh=gV&mm=31%2C26&mn=sn-4g5lznle%2Csn-5hneknes&ms=au%2Conr&mv=m&mvi=5&pl=24&rms=au%2Cau&pcm2=no&initcwndbps=4411250&bui=AUWDL3wOnNED6gq99PgsLW_EHJ7HwdLIby3uavesBsnVP35kKaINeGLtY-cWnI74dLR7n-qi-jWGNgc_&spc=RjZbSVYzCQCxZ55MbJ2XswEO2sHOs2QkdOCOJ8IWxTikq_4zq1HCvHiZkvWdelDRg9N39Q&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=zCNpE3kwHOYMKv5lls7FkkUQ&rqh=1&gir=yes&clen=1018843&dur=60.021&lmt=1729554680378458&mt=1740474291&fvip=4&keepalive=yes&lmw=1&fexp=51326932&c=TVHTML5&sefc=1&txp=5432434&n=oKj9PwFmW1t96g&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgBVmmVRqnD_qGx4A2HiWbwxiQwtcfGuyrTngVQhuh_2QCIFAfkyOOcZH1FQjeifzyrGYicEHgCDc9nlfuIurPJl7U&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhALF87TuAQxFBdir_A_phuOXRyN2avMVTHzBj6v4Gm13dAiEA3aABBcDmhc8MOTgf4aY5tLfAe7qUpeWFG2CB88xpFUk%3D':
  Metadata:
    encoder         : google/video-file
  Duration: 00:01:00.02, start: -0.007000, bitrate: 135 kb/s
  Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (av1 (libdav1d) -> vp9 (libvpx-vp9))
  Stream #1:0 -> #0:1 (opus (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libopus @ 0x79b1a729f0] No bit rate set. Defaulting to 96000 bps.
[libvpx-vp9 @ 0x79b1a76650] v1.14.0
[libvpx-vp9 @ 0x79b1a76650] Neither bitrate nor constrained quality specified, using default CRF of 32
Output #0, webm, to 'file:/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/20/1. Vsauce - The Last Photograph We Took Of Earth [00∶00∶00].webm.part':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6av01mp41
    encoder         : Lavf61.1.100
  Stream #0:0(und): Video: vp9, yuv420p(tv, smpte170m/bt470bg/bt709, progressive), 720x1280 [SAR 1:1 DAR 9:16], q=2-31, 29.97 fps, 1k tbn (default)
      Metadata:
        creation_time   : 2025-01-31T07:14:46.000000Z
        handler_name    : ISO Media file produced by Google Inc.
        vendor_id       : [0][0][0][0]
        encoder         : Lavc61.3.100 libvpx-vp9
      Side data:
        cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, flt, 96 kb/s (default)
      Metadata:
        encoder         : Lavc61.3.100 libopus


ERROR: ffmpeg exited with code -4
@madmini madmini added the bug Something isn't working label Feb 25, 2025
@madmini madmini mentioned this issue Feb 25, 2025
10 tasks
@deniscerri
Copy link
Owner

Can you forward this issue to yt-dlp, as its not really related to the app itself but the library. Thanks

@deniscerri deniscerri added the yt-dlp related Not a bug about the app but with the yt-dlp library label Feb 25, 2025
@madmini
Copy link
Contributor Author

madmini commented Feb 26, 2025

The same yt-dlp command (only removing the -P ... part) works normally when I try it on the same device in termux (see setup, tested with yt-dlp version 2025-02-19).

@deniscerri
Copy link
Owner

Well -P is necessary. It can't be removed 🤔

@madmini
Copy link
Contributor Author

madmini commented Feb 26, 2025

In the command from the log, -P "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/20" just specifies the output path. I had to remove it for testing, as I did not have permissions for that directory in termux. If omitted, it just uses the current directory.

@deniscerri
Copy link
Owner

This might be a ffmpeg bug. What ffmpeg version do u have in termux. I believe the app uses 7.0.1

@error-reporting
Copy link

error-reporting commented Feb 26, 2025

This might be a ffmpeg bug. What ffmpeg version do u have in termux. I believe the app uses 7.0.1

termux has ffmpeg 7.1 and in the op's logs I don't see any sponsorblock url

@deniscerri
Copy link
Owner

Can someone try with the same ffmpeg if the error is reproducable

@error-reporting
Copy link

so you mean try with ffmpeg 7.0.1

@deniscerri
Copy link
Owner

Yeah

@error-reporting
Copy link

error-reporting commented Feb 27, 2025

Yeah

Ffmpeg actually just needs to be recompiled with --enable-librav1e --enable-libaom and --enable-vp9

@madmini
Copy link
Contributor Author

madmini commented Feb 27, 2025

Seems youre right. The same download as above works perfectly when I prefer AVC (or HEVC). Just fails when it needs to re-encode VP9 or AV1.

@deniscerri
Copy link
Owner

@error-reporting I made an issue but looking at how ffmpeg is built with termux packages, only --enable-vp9 is missing

@deniscerri
Copy link
Owner

Also the command is --enable-vp9-highbitdepth instead of --enable-vp9?

@error-reporting
Copy link

error-reporting commented Mar 3, 2025

looking at the ffmpeg build info in ytdlnis --enable-librav1e --enable-libaom --enable-indev=lavfi --enable-gnutls --enable-gpl --enable-libgme --enable-libharfbuzz is missing

@deniscerri
Copy link
Owner

Huh 🤔

@error-reporting
Copy link

ffmpeg 7.1 is a good version to use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working yt-dlp related Not a bug about the app but with the yt-dlp library
Projects
None yet
Development

No branches or pull requests

3 participants