marcelGoerentz / Threadfin

MIT License
3 stars 1 forks source link

Customize no more stream image #13

Open PilaScat opened 3 months ago

PilaScat commented 3 months ago

I would like to write some instructions for my users, it would be nice

marcelGoerentz commented 3 months ago

Hmmm you want a costumized image that will be shown? Or did I get you wrong?

PilaScat commented 3 months ago

Yeah, it would be sufficient uploading it to the config folder without dialog in the webui

marcelGoerentz commented 3 months ago

Okay, I will check how this will be possible 😄

marcelGoerentz commented 3 months ago

I'm thinking about how this could be done in a good way.

The current way is that the image is saved in the source code and the base64 encoded bytes will be stored in the binary.f I could add a function that will check if there has been placed a file in a specific folder within the configuration folder and use this one instead. But right now I'm not sure how to achieve this.

Would this be a convenient way for you?

PilaScat commented 3 months ago

Yes, it would be perfect

marcelGoerentz commented 2 months ago

The following has been shown to me, in order to use a customized no-more-stream image, it is necessary that ffmpeg / vlc is installed on the computer / container. Then the image must be converted into a video file with ffmpeg / vlc. Then I can replace the video file used by Threadfin with the newly created one.

I can make this function even easier by adding a dialog that allows the user to upload the image via the web client, and the rest is done in the backend. Is this a better solution? I mean, I will need more time for implementation, but in the end it will be more self-explanatory and less complicated for the user.

Otherwise, the user will have to put the video file directly into a configuration folder and I will retrieve it from there. -> Much faster to implement, but it will need more description and documentation, plus there are more potential problems since the user can put any file there and I can't check everything.

Translated with DeepL.com (free version)

PilaScat commented 2 months ago

Since is an advanced customization it could be via file on appdata, not necessarily a dialog, probably the faster one for you is right

marcelGoerentz commented 2 months ago

I've pushed a branch where the function should be already implemented, all you need to do is place the video file in the config folder: data/videos/*

PilaScat commented 2 months ago

I've pushed a branch where the function should be already implemented, all you need to do is place the video file in the config folder: data/videos/*

what format? h264? maybe ian image is more straightforward

marcelGoerentz commented 2 months ago

Yes h264 is good, any codec supported by mpeg-ts is acceptable. I‘ve added a readme in resources folder how to create a video from an image via vlc or femora.

marcelGoerentz commented 2 months ago

This is the first step to the implementation, the next will be to use a image placed by the user. 😄

PilaScat commented 2 months ago

In the next days I'll try, for now there's a match, I cannot test ahah

marcelGoerentz commented 2 months ago

No worries, if no one is complaining about the latest beta, then I will release a new beta with this code today.

PilaScat commented 2 months ago

I'm on stable for now

marcelGoerentz commented 2 months ago

Added functions to check for an image in config/data/images/costum/ and generate a video from the file with ffmpeg or vlc!

Next step will be to add the user interface in the web client.

PilaScat commented 2 months ago

/costum/

/custom/ ?

marcelGoerentz commented 2 months ago

The name is irrelevant since threadfin will take the first file found. The complete path could be: .threadfin/data/images/custom/img.jpg

marcelGoerentz commented 2 months ago

So I've also implemented the user interface in the web client. Everything can be found in the latest beta.

PilaScat commented 2 months ago

Perfect, I'll try soon

marcelGoerentz commented 2 months ago

Is everything working as expected?

Do I need to add more tips on how to import the new image?

PilaScat commented 2 months ago

I didn't had time to try it out, I'll keep you updated

marcelGoerentz commented 2 months ago

@PilaScat Did you have any time recently? I want to push the feature to main release.

PilaScat commented 2 months ago

no, I'll try now

PilaScat commented 2 months ago

uploaded but I see the default image, even restarted threadfin I used this No more streams

marcelGoerentz commented 2 months ago

Do you have log entries? I‘ll check to Night what’s going on. I didn’t had an issue when testing

PilaScat commented 2 months ago

Do you have log entries? I‘ll check to Night what’s going on. I didn’t had an issue when testing

No logs

marcelGoerentz commented 2 months ago

I've found the bug, fixed it in the newest beta

PilaScat commented 2 months ago

But now there is a permission problem, all functionality is broken I would also be fine with creating the .ts file and putting it in the folder, without having to make threadfin do extra things that could break it

marcelGoerentz commented 2 months ago

Aren‘t you running the latest docker build ?

PilaScat commented 2 months ago

Aren‘t you running the latest docker build ?

latest beta

marcelGoerentz commented 2 months ago

I‘ve tested it with the beta tag. And it was working as expected. I really need to see the logs. Nevertheless, when you have created the .ts file you can place it in the config folder under config/data/video/ Threadfin will get it from there. Just for your info, if you are placing mir then one file in that dir Threadfin will delete them.

PilaScat commented 2 months ago

I‘ve tested it with the beta tag. And it was working as expected. I really need to see the logs. Nevertheless, when you have created the .ts file you can place it in the config folder under config/data/video/ Threadfin will get it from there. Just for your info, if you are placing mir then one file in that dir Threadfin will delete them.

only in beta right? because I can't test if the streams doesn't work

marcelGoerentz commented 2 months ago

Yes right now it’s only in the beta.

PilaScat commented 2 months ago

I recommend keeping it as an advanced option, without an interface, just adding the video file to the folder whoever wants to do it will prepare the .ts file independently, maybe leaving something written in the readme this way we avoid possible errors and waste of time since I will probably be the only one to use it 😂 thank you very much for the work you are doing

marcelGoerentz commented 2 months ago

No worries, the interface is just an add on 😆 The code is completely the same

PilaScat commented 2 months ago

I saw that in the new beta it create a user and assign it to threadfin and ffmpeg, that's what doesn't make things work, I guess it's for ffmpeg image to video encoding, but if it causes problems I'll do it from my pc then upload the video

marcelGoerentz commented 2 months ago

Actually it should not cause problems as all the permissions will be checked on start up. But I need to see the logs, so I know what is going wrong in your container. I‘ve set up a new container and everything was working fine.

PilaScat commented 2 months ago
2024/09/12 11:14:17 [Threadfin] Version:                1.5 Build: 0
2024/09/12 11:14:17 [Threadfin] Database Version:       0.5.0
2024/09/12 11:14:17 [Threadfin] System IP Addresses:    IPv4: 3 | IPv6: 0
2024/09/12 11:14:17 [Threadfin] Hostname:               b3a72f6b6587
2024/09/12 11:14:17 [Threadfin] System Folder:          /home/threadfin/conf/
2024/09/12 11:14:17 [Threadfin] Load Settings:          /home/threadfin/conf/settings.json
2024/09/12 11:14:17 [Threadfin] Git Branch:             Switching Git Branch to -> main
2024/09/12 11:14:17 [Threadfin] [ERROR] open /home/threadfin/conf/permission.test: permission denied (Invalid file permissions for config folder) - EC: 1015
2024/09/12 11:14:17 [Threadfin] Temporary Folder:       /tmp/threadfin/2024-07-OSF4-W9J7TW/
2024/09/12 11:14:17 [Threadfin] [ERROR] open /tmp/threadfin/2024-07-OSF4-W9J7TW/permission.test: permission denied (Invalid file permissions for temp folder) - EC: 1016
2024/09/12 11:14:17 [Threadfin] [ERROR] unlinkat /tmp/threadfin/2024-07-OSF4-W9J7TW/PIDs: permission denied () - EC: 0
Error scanning file PIDs: open /tmp/threadfin/2024-07-OSF4-W9J7TW/PIDs: permission deniedGit Branch is now: main

I need to reopen ahah

Do you have log entries? I‘ll check to Night what’s going on. I didn’t had an issue when testing

No logs

at least now I have them

PilaScat commented 2 months ago

for now I've rolled back to v1.4.1

marcelGoerentz commented 2 months ago

In my opinion you should make a back up, delete the container, pull the latest image from docker and restore your backup. Then everything should work as expected.

PilaScat commented 2 months ago

Did but same problem:

Git Branch is now: main
2024/09/13 18:16:56 [Threadfin] [ERROR] mkdir /home/threadfin/conf/backup/: permission denied (Folder could not be created.) - EC: 1070
2024/09/13 18:16:56 [Threadfin] [ERROR] mkdir /home/threadfin/conf/backup/: permission denied () - EC: 0
marcelGoerentz commented 2 months ago

Hmm, is someone else having this problem? I will check if I can do anything to fix this…

marcelGoerentz commented 2 months ago

This are the log I get when creating a new container from the latest image:

2024-09-13 22:04:24 Git Branch is now: main
2024-09-13 22:04:24 For help run: /home/threadfin/bin/threadfin -h
2024-09-13 22:04:24 
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Version:                1.5 Build: 0
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Database Version:       0.5.0
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] System IP Addresses:    IPv4: 2 | IPv6: 1
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Hostname:               87417c7cd8b4
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] System Folder:          /home/threadfin/conf/
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Load Settings:          /home/threadfin/conf/settings.json
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Git Branch:             Switching Git Branch to -> main
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] SOURCE:                 PMS
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Temporary Folder:       /tmp/threadfin/2024-09-MQMF-TQM75Q/
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] GitHub:                 https://github.com/marcelGoerentz
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Git Branch:             Main [marcelGoerentz]
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] SSDP / DLNA:            true
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] [WARNING] Updates are disabled in the settings
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] UUID:                   2024-09-MQMF-TQM75Q
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Tuner (Plex / Emby):    1
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] EPG Source:             PMS
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Plex Channel Limit:     480
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Unfiltered Chan. Limit: 480
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] All streams:            0
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Active streams:         0
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Filter:                 0
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] DVR IP:                 127.0.0.1:34400
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Web Interface:          http://127.0.0.1:34400/web/
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] DVR IP:                 172.17.0.2:34400
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Web Interface:          http://172.17.0.2:34400/web/
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] DVR IP:                 ::1:34400
2024-09-13 22:04:24 2024/09/13 20:04:24 [Threadfin] Web Interface:          http://::1:34400/web/
marcelGoerentz commented 2 months ago

Are you able to test again with the latest beta? I've updated the image again.

PilaScat commented 2 months ago

il try soon, I've have a lot of exams in university ahaha Probably there is a problem with the counter of active tuner in the playlist (it tells me no more streams but I'm using 2/3 channels)

marcelGoerentz commented 2 months ago

Regarding the counter that is a known issue. I would recommend to use the API. I think I will delete the counter as they are not necessary anymore with the API.

PilaScat commented 2 months ago

Not the web ui one

marcelGoerentz commented 2 months ago

It seems like I really have to rework the buffer. It should not happen that there are streams still working when not listed.

PilaScat commented 1 month ago

API? Where can I change? I pay 3 streams to my m3u, I would like to use them ahahha

PilaScat commented 1 month ago

with the latest beta: docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "${THREADFIN_BIN}": executable file not found in $PATH: unknown.