Youtube videos seems to play at low bitrate
Is there a reason for why does Youtube videos played through the bot looks way worse than on Youtube itself? It also looks way worse than Twitch streams in the bot. I will post a few comparision:
Original video viewed in Youtube:
The bot playing that Youtube video:
The bot playing a Twitch stream:
Edit: I think that youtube livestreams also looks better than youtube videos.
Which version of the bot have you tested this on? Can you test this using v1.1.6?
Which version of the bot have you tested this on? Can you test this using v1.1.6?
I'm using the image "quay.io/ydrag0n/streambot:latest". I'm assuming that is already the v1.1.6?
Use the v1.1.6 tag.
as latest means to be the dev branch.
quay.io/ydrag0n/streambot:v1.1.6
Use the
v1.1.6tag. as latest means to be the dev branch.quay.io/ydrag0n/streambot:v1.1.6
I have just tried that version and it has the same issue:
Did you try to increase the stream options, such as the stream bitrate or enabling hardware acceleration?
Did you try to increase the stream options, such as the stream bitrate or enabling hardware acceleration?
I did increase the stream bitrate to 3000, but it doesn't make a difference (in YouTube videos), it's like the bot is not applying that bitrate when playing YouTube videos or are playing them in low resolution (480p or something like that).
I didn't enable hardware acceleration as I thought it wasn't supported in Docker. Is it supported? Is there a way to check if it's working?
Thanks!
I think this issue is related to ytdl-core, as it is limited to fetching a maximum quality of 360p for some videos, though this limitation does not apply to live videos. I will look for a solution later to use ytdlp instead.
Yt-dlp will result in the same result, there's inconsistency in the "resolution" chosen and idk why, even if you tried to use -f best/ba+bv, ( best will result in the highest available merged format, maybe 720 480 360 1080, depends, but ba+bv will give highest video resolution and audio bitrate, but needs a bit of merging on the fly ). Hope it helps! @ysdragon
Yes, i will use merged formats (highest available video + highest available audio).
Yes, i will use merged formats (highest available video + highest available audio).
This will work, but i do guess that it will need more resources? Because transcoding on fly is a bit of headache
but i do guess that it will need more resources?
Yes, it will require resources depending on the parameters of each video. Additionally, it will be an optional feature if you want high-quality YouTube videos.
but i do guess that it will need more resources?
Yes, it will require resources depending on the parameters of each video. Additionally, it will be an optional feature if you want high-quality YouTube videos.
If you can make the user choose it as a default setting, or in video commands, this would be good
but i do guess that it will need more resources?
Yes, it will require resources depending on the parameters of each video. Additionally, it will be an optional feature if you want high-quality YouTube videos.
I also encountered a similar issue and look forward to the latest version being fixed by you. I would like to suggest a method for retrieving the token with the following code, as it is simpler and faster (webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken() Maybe I will fix it
but i do guess that it will need more resources?
Yes, it will require resources depending on the parameters of each video. Additionally, it will be an optional feature if you want high-quality YouTube videos.
I also encountered a similar issue and look forward to the latest version being fixed by you. I would like to suggest a method for retrieving the token with the following code, as it is simpler and faster
(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken()Maybe I will fix it
It's already in the wiki and works perfectly! https://github.com/ysdragon/StreamBot/wiki/Get-Discord-user-token#3-open-browser-devtools-and-run-the-code-discord-console---ctrl--shift--i
Hi @outerwinnie et al,
We no longer depend on ytdl-core. We are now using yt-dlp. You can try it out again to see if this issue still exists.
Hi @outerwinnie et al,
We no longer depend on ytdl-core. We are now using yt-dlp. You can try it out again to see if this issue still exists.
I'm using v1.2.0 trying with this video: https://www.youtube.com/watch?v=LOvkfpenFtg&t
Discord bot:
Youtube video (720p):
It looks worst than the same video in youtube still.
Hi @outerwinnie et al, We no longer depend on ytdl-core. We are now using yt-dlp. You can try it out again to see if this issue still exists.
I'm using v1.2.0 trying with this video: https://www.youtube.com/watch?v=LOvkfpenFtg&t
Discord bot:
Youtube video (720p):
It looks worst than the same video in youtube still.
Have you tried to maximize the FPS and bitrate? Could you share your .env settings (omitting any sensitive data, of course) so we can try to reproduce it?
Hi @outerwinnie et al, We no longer depend on ytdl-core. We are now using yt-dlp. You can try it out again to see if this issue still exists.
I'm using v1.2.0 trying with this video: https://www.youtube.com/watch?v=LOvkfpenFtg&t Discord bot:
Youtube video (720p):
It looks worst than the same video in youtube still. _streambot_logs.txt
Have you tried to maximize the FPS and bitrate? Could you share your .env settings (omitting any sensitive data, of course) so we can try to reproduce it?
I changed the bitrate yes, i did not changed the FPS:
services:
streambot:
image: quay.io/ydrag0n/streambot:latest
container_name: streambot
restart: always
environment:
# General options
VIDEOS_DIR: "./videos" # The local path where you store video files
PREVIEW_CACHE_DIR: "./tmp/preview-cache" # The local path where your self-bot will cache video preview thumbnails
# Stream options
STREAM_RESPECT_VIDEO_PARAMS: "false" # This option is used to respect video parameters such as width, height, fps, bitrate, and max bitrate.
STREAM_WIDTH: "1280" # The width of the video stream in pixels
STREAM_HEIGHT: "720" # The height of the video stream in pixels
STREAM_FPS: "30" # The frames per second (FPS) of the video stream
STREAM_BITRATE_KBPS: "6000" # The bitrate of the video stream in kilobits per second (Kbps)
STREAM_MAX_BITRATE_KBPS: "6500" # The maximum bitrate of the video stream in kilobits per second (Kbps)
STREAM_HARDWARE_ACCELERATION: "false" # Whether to use hardware acceleration for video decoding, set to "true" to enable, "false" to disable
STREAM_VIDEO_CODEC: "H264" # The video codec to use for the stream, can be "H264" or "H265" or "VP8"
# STREAM_H26X_PRESET: Determines the encoding preset for H26x video streams.
# If the STREAM_H26X_PRESET environment variable is set, it parses the value
# using the parsePreset function. If not set, it defaults to 'ultrafast' for
# optimal encoding speed. This preset is only applicable when the codec is
# H26x; otherwise, it should be disabled or ignored.
# Available presets: "ultrafast", "superfast", "veryfast", "faster",
# "fast", "medium", "slow", "slower", "veryslow".
STREAM_H26X_PRESET: "ultrafast"
# Videos server options
SERVER_ENABLED: "false" # Whether to enable the built-in video server
SERVER_USERNAME: "admin" # The username for the video server's admin interface
SERVER_PASSWORD: "admin" # The password for the video server's admin interface
SERVER_PORT: "3000" # The port number the video server will listen on
volumes:
- ./videos:/home/bots/StreamBot/videos
ports:
- 3005:3000
I assume the quality of the download video is 720p? I was trying to play the same video, started to stutter and then crashed:
https://streamable.com/1y56e0