hama3254 / Crunchyroll-Downloader-v3.0

Downloader for Crunchyroll
843 stars 108 forks source link

It is possible to change the bitrate from copy preset and have multidownload? #829

Closed ijorel closed 9 months ago

ijorel commented 10 months ago

Hello i have tried most o of the preset downloads or the ffmpeg command with multiple episodes downloads and the command "copy" is the only allows me to download 12 file simultaneously but the bitrate is about 7000k and i want it on the range of 2500k - 3000k, is there a posibility to change that bitrates?

image

hama3254 commented 10 months ago

-c copy does what the names says copy the video stream, if you want to change the bitrate you have to select an encoder instead of copy. The encoder is dependent on your preferences (h264, h265 or AV1) and hardware (nvenc for Nvidia GPUs, amf for AMD and qsv for Intel). All encoders should be limited at best to 2 download since it either limited by the driver or the hardware. CR usues h264 with mostly 8 MBit/s for 1080p.

ijorel commented 10 months ago

when i select h264 on amf (fo amd) the app download process crashed,

image

hama3254 commented 10 months ago

I don't have access to any AMD GPU so I can not test it, but the ffmpeg log might contain something helpful.

ijorel commented 10 months ago

Ok this is the log


10/18/2023 11:40:31 AM -user_agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.46" -headers "ACCEPT-ENCODING: *" -i "https://v.vrv.co/evs3/f66b07b5f0db23ad1be44c9ebe7055da/assets/x55u5cj8ax44bm5_2176173.mp4/index-v1-a1.m3u8?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly92LnZydi5jby9ldnMzL2Y2NmIwN2I1ZjBkYjIzYWQxYmU0NGM5ZWJlNzA1NWRhL2Fzc2V0cy94NTV1NWNqOGF4NDRibTVfKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5Nzc0MDgyOX19fV19&Signature=NtSwcQu31GdelBPno~812~0Jf440fD7q6Z3XvGPHZ8gw1dJS85QV1~h5tmsKaAGgS1dW0t8oXwa2uvw83KgnenPv5s0~nQGGKPkicj0x3t-62Nby9tsnMy2xl29LjKPwjQZNxh-kYZGlu2kTyFfY65ux-kDs~ziy9dH~b4fsZhOaGgl9j3UKkVyUhhxwk74PrHmJPpRclNhEhS~SSb26BDJ-63GViUSJT2~JMasaYfzjiXoUWELnGJXZM4-LlLvZnjB2MUOiNaPxi08hGXWIUK8-n0H0tckwwApxFVUlzUAgv3oj8VwWYqwbvTXtV2Nurdmz~hcGuD0DJWqEGv12iA__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA" -metadata:s:a:0 language=jpn -c:v h264_amf -preset fast -b:v 2500k -c:a copy -bsf:a aac_adtstoasc "C:\Users\SMARTBOX\OneDrive\Documents\Ore Monogatari!!\S1\Ore Monogatari!! S1 E24 Japanese.mp4"

10/18/2023 11:40:31 AM ffmpeg version 5.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
10/18/2023 11:40:31 AM   built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
10/18/2023 11:40:31 AM   configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
10/18/2023 11:40:31 AM   libavutil      57. 28.100 / 57. 28.100
10/18/2023 11:40:31 AM   libavcodec     59. 37.100 / 59. 37.100
10/18/2023 11:40:31 AM   libavformat    59. 27.100 / 59. 27.100
10/18/2023 11:40:31 AM   libavdevice    59.  7.100 / 59.  7.100
10/18/2023 11:40:31 AM   libavfilter     8. 44.100 /  8. 44.100
10/18/2023 11:40:31 AM   libswscale      6.  7.100 /  6.  7.100
10/18/2023 11:40:31 AM   libswresample   4.  7.100 /  4.  7.100
10/18/2023 11:40:31 AM   libpostproc    56.  6.100 / 56.  6.100
10/18/2023 11:40:31 AM [https @ 0000022f412a6d80] No trailing CRLF found in HTTP header. Adding it.
10/18/2023 11:40:32 AM [hls @ 0000022f41291480] Skip ('#EXT-X-VERSION:3')
10/18/2023 11:40:32 AM [hls @ 0000022f41291480] Opening 'https://v.vrv.co/evs3/f66b07b5f0db23ad1be44c9ebe7055da/assets/x55u5cj8ax44bm5_2176173.mp4/encryption.key?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly92LnZydi5jby9ldnMzL2Y2NmIwN2I1ZjBkYjIzYWQxYmU0NGM5ZWJlNzA1NWRhL2Fzc2V0cy94NTV1NWNqOGF4NDRibTVfMjE3NjE3My5tcDQvKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5Nzc0MDgzM319fV19&Signature=M2gkMHvvund85z9-PVVlkvHn1S0gn3RD~kiWLoqhr48Xk-MlOvea76VGkPjw-CyJGnyU~cx5U9BCGVgWDvZdrxTuZL0Ej91Ho-tbvHFqJozi5suDnxf3lm1Tynhgox82AKWVUfOptz4UYnLlU5Qx-Fhww8AKKU2Wc7CH87AicInl-OFLigDsHZhuiPANKGRaI0taoWE-2pSiS55Zu6-RbNWE5~C~KzdF0UFnUW2H8rZri-fQiy-ZvTHvMlWq504e1Zc-uxe-K7D2Q74mN7iYNqsvLz943rkSLLO0zV4NwvWQt20uDMhOyL8fVVC21f2Wj7dlgeXaHhzjODbTpeAYng__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA' for reading
10/18/2023 11:40:32 AM [hls @ 0000022f41291480] Opening 'crypto+https://v.vrv.co/evs3/f66b07b5f0db23ad1be44c9ebe7055da/assets/x55u5cj8ax44bm5_2176173.mp4/seg-1-v1-a1.ts?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly92LnZydi5jby9ldnMzL2Y2NmIwN2I1ZjBkYjIzYWQxYmU0NGM5ZWJlNzA1NWRhL2Fzc2V0cy94NTV1NWNqOGF4NDRibTVfMjE3NjE3My5tcDQvKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5Nzc0MDgzM319fV19&Signature=M2gkMHvvund85z9-PVVlkvHn1S0gn3RD~kiWLoqhr48Xk-MlOvea76VGkPjw-CyJGnyU~cx5U9BCGVgWDvZdrxTuZL0Ej91Ho-tbvHFqJozi5suDnxf3lm1Tynhgox82AKWVUfOptz4UYnLlU5Qx-Fhww8AKKU2Wc7CH87AicInl-OFLigDsHZhuiPANKGRaI0taoWE-2pSiS55Zu6-RbNWE5~C~KzdF0UFnUW2H8rZri-fQiy-ZvTHvMlWq504e1Zc-uxe-K7D2Q74mN7iYNqsvLz943rkSLLO0zV4NwvWQt20uDMhOyL8fVVC21f2Wj7dlgeXaHhzjODbTpeAYng__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA' for reading
10/18/2023 11:40:33 AM Input #0, hls, from 'https://v.vrv.co/evs3/f66b07b5f0db23ad1be44c9ebe7055da/assets/x55u5cj8ax44bm5_2176173.mp4/index-v1-a1.m3u8?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly92LnZydi5jby9ldnMzL2Y2NmIwN2I1ZjBkYjIzYWQxYmU0NGM5ZWJlNzA1NWRhL2Fzc2V0cy94NTV1NWNqOGF4NDRibTVfKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5Nzc0MDgyOX19fV19&Signature=NtSwcQu31GdelBPno~812~0Jf440fD7q6Z3XvGPHZ8gw1dJS85QV1~h5tmsKaAGgS1dW0t8oXwa2uvw83KgnenPv5s0~nQGGKPkicj0x3t-62Nby9tsnMy2xl29LjKPwjQZNxh-kYZGlu2kTyFfY65ux-kDs~ziy9dH~b4fsZhOaGgl9j3UKkVyUhhxwk74PrHmJPpRclNhEhS~SSb26BDJ-63GViUSJT2~JMasaYfzjiXoUWELnGJXZM4-LlLvZnjB2MUOiNaPxi08hGXWIUK8-n0H0tckwwApxFVUlzUAgv3oj8VwWYqwbvTXtV2Nurdmz~hcGuD0DJWqEGv12iA__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA':
10/18/2023 11:40:33 AM   Duration: 00:22:52.08, start: 0.101000, bitrate: N/A
10/18/2023 11:40:33 AM   Program 0 
10/18/2023 11:40:33 AM     Metadata:
10/18/2023 11:40:33 AM       variant_bitrate : 0
10/18/2023 11:40:33 AM   Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
10/18/2023 11:40:33 AM     Metadata:
10/18/2023 11:40:33 AM       variant_bitrate : 0
10/18/2023 11:40:33 AM   Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp
10/18/2023 11:40:33 AM     Metadata:
10/18/2023 11:40:33 AM       variant_bitrate : 0
10/18/2023 11:40:33 AM   Stream #0:2: Data: timed_id3 (ID3  / 0x20334449)
10/18/2023 11:40:33 AM     Metadata:
10/18/2023 11:40:33 AM       variant_bitrate : 0
10/18/2023 11:40:33 AM Stream mapping:
10/18/2023 11:40:33 AM   Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_amf))
10/18/2023 11:40:33 AM   Stream #0:1 -> #0:1 (copy)
10/18/2023 11:40:33 AM Press [q] to stop, [?] for help
10/18/2023 11:40:33 AM [h264_amf @ 0000022f43b70e80] CreateComponent(AMFVideoEncoderVCE_AVC) failed with error 1
10/18/2023 11:40:33 AM Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
10/18/2023 11:40:33 AM Conversion failed!
10/18/2023 11:40:33 AM 
10/18/2023 11:40:33 AM 

and there's one error appears

image

ijorel commented 10 months ago

the amd card is a rx6400

hama3254 commented 10 months ago

the amd card is a rx6400

What I found is that this GPU has not the required hardware to allow for GPU encoding. Source Reddit The reddit post also gives suggestions like trying the iGPU of his Intel processor which should work on must except F version since the don't have a iGPU. Other options are software encoding (libx264 for h264) which the Downloader will limit to 1 stream since it will use 100% of practically any CPU you could have.

ijorel commented 10 months ago

ok got it, and for this error what can i do?

image

hama3254 commented 10 months ago

This is a response issue from CR, it usually happen if download for longer time and the cookies would need to be refreshed. If this happens after some downloads you should just close and restart the downloader.

ijorel commented 10 months ago

Hello, i have restarted the app and wont work, how can i refresh cookies in order to continue downloading large queue because this error repeats until the queue procees all the list. it is possible to pause the queue until the cookies refresh?

ijorel commented 10 months ago

the solution is wait about 10-15 min but i need to add queue again, and for more than 41 videos it start to send me the error 403, my question is if its possible to do the pause until the app can resume downloads

hama3254 commented 10 months ago

The Downloader is not build for such large download numbers. I set a season of 12 episodes per session this should be more than enough for the private use for what the downloader is build.

x3inspire commented 9 months ago

The Downloader is not build for such large download numbers. I set a season of 12 episodes per session this should be more than enough for the private use for what the downloader is build.

Could you increase it please?

hama3254 commented 9 months ago

@x3inspire i already explained that in #789.