NickvisionApps / Parabolic

Download web video and audio
https://flathub.org/apps/details/org.nickvision.tubeconverter
GNU General Public License v3.0
992 stars 54 forks source link

Download fails with "Cannot allocate memory" #160

Closed swick closed 1 year ago

swick commented 1 year ago
[ZDF] Extracting URL: https://www.zdf.de/show/mai-think-x-die-show/maithink-x-folge-24-100.html
[ZDF] maithink-x-folge-24-100: Downloading webpage
[ZDF] maithink-x-folge-24-100: Downloading JSON content
[ZDF] maithink-x-folge-24-100: Downloading JSON metadata
[ZDF] 230402_sendung24_mai: Downloading m3u8 information
[ZDF] 230402_sendung24_mai: Downloading m3u8 information
[ZDF] 230402_sendung24_mai: Downloading m3u8 information
[ZDF] 230402_sendung24_mai: Downloading m3u8 information
[info] 230402_sendung24_mai: Downloading 1 format(s): http-h264_aac_mp4_http_na_na-fhd
[info] Downloading video thumbnail 5 ...
[info] Writing video thumbnail 5 to: /var/home/swick/.var/app/org.nickvision.tubeconverter/config/Nickvision/Nickvision Tube Converter/temp/e273b3d1-029a-4076-8e97-205c61a3fc3e/Der\ gefährliche\ Naturtrend\.jpg
[download] Destination: /var/home/swick/.var/app/org.nickvision.tubeconverter/config/Nickvision/Nickvision Tube Converter/temp/e273b3d1-029a-4076-8e97-205c61a3fc3e/Der\ gefährliche\ Naturtrend\.mp4

[download]   0.0% of    1.12GiB at  Unknown B/s ETA Unknown
[download]   0.0% of    1.12GiB at    1.39MiB/s ETA 13:56  
[download]   0.0% of    1.12GiB at    2.55MiB/s ETA 07:33
[download]   0.0% of    1.12GiB at    4.51MiB/s ETA 04:16

...

[download]  99.9% of    1.12GiB at    7.11MiB/s ETA 00:00
[download] 100.0% of    1.12GiB at    7.11MiB/s ETA 00:00
[download] 100% of    1.12GiB in 00:02:42 at 7.10MiB/s   
[Metadata] Adding metadata to "/var/home/swick/.var/app/org.nickvision.tubeconverter/config/Nickvision/Nickvision Tube Converter/temp/e273b3d1-029a-4076-8e97-205c61a3fc3e/Der\ gefährliche\ Naturtrend\.mp4"
ERROR: Postprocessing: file:/var/home/swick/.var/app/org.nickvision.tubeconverter/config/Nickvision/Nickvision Tube Converter/temp/e273b3d1-029a-4076-8e97-205c61a3fc3e/Der\ gefährliche\ Naturtrend\.meta: Cannot allocate memory
fsobolev commented 1 year ago

You're running out of RAM. I doubt we can do something here, Tube Converter is not that memory hungry, I use it on a machine with 3Gb+zram with no issues while also having a lot of other apps running. I also successfully downloaded the video you tried to download. If you have low RAM and don't have zram configured, consider using it: https://wiki.archlinux.org/title/Zram (the article is from Arch Wiki, but you can find a way to use it on any distro).

swick commented 1 year ago

That's certainly not what's going on. I have 46gb of free memory right now.

fsobolev commented 1 year ago

Okay, that's interesting... @nlogozzo any ideas?

swick commented 1 year ago

Things that might have been weird:

nlogozzo commented 1 year ago

1.12GiB

That's a big file...maybe ffmpeg or yt-dlp has a limit on memory usage?

the download folder and the flatpak data are on different devices

shouldn't be an issue as long as you gave flatpak permissions to that folder

there were actual backslashes in the filename of the temp folder

again shouldn't be an issue, @fsobolev maybe we should unescape filename in the temp folder too?

fsobolev commented 1 year ago

there were actual backslashes in the filename of the temp folder

This is expected. Postprocessing can fail if there are special characters in a filename, so a filename always gets escaped while downloading and then unescaped when the download is finished.

@fsobolev maybe we should unescape filename in the temp folder too?

We can't unescape filenames in the middle. If yt-dlp downloaded the file escaped, it will pass it escaped to ffmpeg. We can unescape the text in the log in the app, but I don't see a point why we should do this.

That's a big file...maybe ffmpeg or yt-dlp has a limit on memory usage?

I can download it, so it's not this.

I selected to download subtitles for this file and the log complained that there are none

This is completely separate issue that I can reproduce. Not sure why this happens tho, I will investigate.

fsobolev commented 1 year ago

Found the culprit. My bad, I should have checked whether embed metadata setting was enabled. And it wasn't for me, that's why downloads were successful. "Cannot allocate memory" error happens on metadata embedding.

Regarding subtitles, the problem is that subtitles for this video have "deu" language code, but in TC we filter subtitles to download only ones for English and system language - that can be "de", but not "deu". @nlogozzo should we disable subtitles filter and download everything?

nlogozzo commented 1 year ago

Regarding subtitles, the problem is that subtitles for this video have "deu" language code, but in TC we filter subtitles to download only ones for English and system language - that can be "de", but not "deu". @nlogozzo should we disable subtitles filter and download everything?

Maybe if english or the system language is not found then we just download everything.

nlogozzo commented 1 year ago

https://github.com/nlogozzo/NickvisionTubeConverter/releases/tag/2023.4.1