ShaneIsrael / fireshare

Self host your media and share with unique links
GNU General Public License v3.0
682 stars 41 forks source link

Video's not processing #177

Closed neldonado closed 1 year ago

neldonado commented 1 year ago

I noticed recently that all of the new videos dropped into the watch folder are not getting processed and showing a thumbnail. When I click on the videos they'll play fine.

https://i.hah.rip/Q0R.png

neldonado commented 1 year ago

image

ShaneIsrael commented 1 year ago

What type of video is it? .mp4, .mkv, etc etc. Do you know what it is encoded in h.265, h.264, etc etc.

Add a new video to the watch folder, run the scan and look at the fireshare container logs, is there an error? if there is copy it and paste it here.

Can you also show me your docker-compose file, this could be an issue with how you set up your volume mounts.

neldonado commented 1 year ago

These are all .mp4 videos, recorded with nvidia shadow play. So I believe this is h.264.

I moved a video into the watch folder and hit scan. These are the logs:

2023-03-25 20:29:57,793 INFO __init__.update_config:27 | Validating configuration file... 2023-03-25 20:29:57,811 INFO cli.bulk_import:256 | A scan process is currently active... Aborting. (Remove /data/fireshare.lock to continue anyway) XXX.XXX.XXX.XXX, XXX.XX.XXX.XXX - - [25/Mar/2023:20:29:58 -0700] "GET /api/loggedin HTTP/1.1" 200 4 "https://mydomain.tld/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/111.0" "172.17.0.1" XXX.XXX.XXX.XXX, XXX.XX.XXX.XXX - - [25/Mar/2023:20:29:58 -0700] "GET /api/videos?sort=updated_at+desc HTTP/1.1" 200 104228 "https://mydomain.tld/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/111.0" "172.17.0.1"

image image
ShaneIsrael commented 1 year ago

That is a log saying that the scan is currently running. I would do this.

  1. Stop fireshare
  2. Add a new video (not one that was already added)
  3. Start fireshare
  4. View the logs and wait until the scan is finished.

The scan might take a minute or two to complete, once the new video shows up check and see if there is an error.

Another thing you can try is recording a video with something that is not Shadowplay. I recently stopped using Shadowplay for my videos because it now records them in h265 which only some browsers and versions support. That could be whats happening here, because its in h265 the scan process might not be able to generate a thumbnail image correctly.

neldonado commented 1 year ago

`[2023-03-26 07:12:04,705] INFO in api: Executed manual scan

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/logging/init.py", line 1083, in emit msg = self.format(record) File "/usr/local/lib/python3.9/logging/init.py", line 927, in format return fmt.format(record) File "/usr/local/lib/python3.9/logging/init.py", line 663, in format record.message = record.getMessage() File "/usr/local/lib/python3.9/logging/init.py", line 367, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Call stack: File "/usr/local/bin/fireshare", line 8, in sys.exit(cli()) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, *kwargs) File "/usr/local/lib/python3.9/site-packages/fireshare/cli.py", line 265, in bulk_import ctx.invoke(sync_metadata) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/usr/local/lib/python3.9/site-packages/fireshare/cli.py", line 149, in sync_metadata info = util.get_media_info(vpath) File "/usr/local/lib/python3.9/site-packages/fireshare/util.py", line 50, in get_media_info logger.warn('Could not extract video info', ex) Message: 'Could not extract video info' Arguments: (CalledProcessError(1, ['ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_entries', 'stream', '/processed/video_links/7435fbc58333c23615c47b0699c8c36c.mp4']),) Traceback (most recent call last): File "/usr/local/bin/fireshare", line 8, in sys.exit(cli()) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, *kwargs) File "/usr/local/lib/python3.9/site-packages/fireshare/cli.py", line 265, in bulk_import ctx.invoke(sync_metadata) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/usr/local/lib/python3.9/site-packages/fireshare/cli.py", line 150, in sync_metadata vcodec = [i for i in info if i['codec_type'] == 'video'][0] TypeError: 'NoneType' object is not iterable XXX.XXX.XXX.XXX, XXX.XX.XXX.XXX- - [26/Mar/2023:07:12:32 -0700] "GET / HTTP/1.1" 200 1048 "-" "Uptime-Kuma/1.21.0" "172.17.0.1"

neldonado commented 1 year ago

Worth noting here that if I hover the thumbnails start playing

https://i.hah.rip/H47.gif

ShaneIsrael commented 1 year ago

The issue is this file right here which is a symlink to the video file in your watch folder that fireshare creates. My guess is that you have files in your watch folder that are not videos OR potentially a corrupt video / invalid video type.

/processed/video_links/7435fbc58333c23615c47b0699c8c36c.mp4

So what happens is fireshare errors on that file which stops the thumbnail creation process from happening. So to figure out what the problem file is run the stat command from your /fireshare_processed/video_links directory against that symlink.

stat 7435fbc58333c23615c47b0699c8c36c.mp4

It should tell you what the file its pointing to is.

neldonado commented 1 year ago

hmm, I had a .ds file in the watch folder, presumably when I mounted the share earlier on my macbook? going to delete that and rescan

neldonado commented 1 year ago

image

I don't have anything in my video links folder?

neldonado commented 1 year ago

hey! I used that to find the video name, deleted the corrupted video and it's all good now! Thanks!