Missing thumbnails for webm/mp4 files
Closed this issue · 8 comments
Server Software
- Shimmie version: 2.12.0-alpha+8a8d78ae
- Database: mysql
- Web server: apache
Client Software
- Device: windows 10
- Browser: firefox 129
What steps trigger this bug
- Go to './post/list'
What did you expect to happen?
Video files (mp4, webm) to have a thumbnail preview
What actually happened?
Only other static formats (jpg, png etc) get thumbnails generated.
Full description
-
It's my first time trying to host a booru for a small community with 0 know-how. The past days I've managed to set it all up with the help of provided documentation + "outsourcing" to ChatGPT. While everything else seems to work fine, I still can't figure out why do mp4/webm files do not get a thumbnail generated.
-
I tried to look up the issue, and found something similar, where the users mentioned ffmpeg missing (doesn't seem to be the case, I ran a "ffmpeg -version" in CLI and got "7.0.1" returned), or ran a different command line (I tried multiple but all returned the same error, pasted from shimmie's event log: "Generating thumbnail with command
'ffmpeg' -y -i 'data/images/0e/0e41b0e1a876995c685d130b4cc4f0e0' -vf scale=192:54,thumbnail -f image2 -vframes 1 -c:v png '/home/customer/site_name/public_html/data/temp/ffmpeg_thumbD1tHvY'
, returns 245".
Regenerating the thumbnail prints the same error. -
Maybe worth mentioning the video files DO play if clicked on.
I'm sorry for bringing up this issue once more, but I've ran out of ideas of what to do, and I don't want to run in circles or, worse, break something.
Thank you kindly in advance, any and all help appreciated!
I can't find information on what an ffmpeg error 245 is, can you try running that command on the image in CLI and see if it gives a descriptive error message?
MP4 and WebM ffmpeg thumbnails are working on my booru but I am using a much older ffmpeg version (not 7.x.x).
I can't find information on what an ffmpeg error 245 is, can you try running that command on the image in CLI and see if it gives a descriptive error message?
MP4 and WebM ffmpeg thumbnails are working on my booru but I am using a much older ffmpeg version (not 7.x.x).
I ran the conversion command in CLI and got:
- [Parsed_scale_0 @ 0x7f8070002c00] Failed to configure output pad on Parsed_scale_0
- [vf#0:0 @ 0x560091fd7a00] Error reinitializing filters!
- [vf#0:0 @ 0x560091fd7a00] Task finished with error code: -11 (Resource temporarily unavailable)
- [vf#0:0 @ 0x560091fd7a00] Terminating thread with return code -11 (Resource temporarily unavailable)
- [vost#0:0/png @ 0x560091fd75c0] Could not open encoder before EOF
- [vost#0:0/png @ 0x560091fd75c0] Task finished with error code: -22 (Invalid argument)
- [vost#0:0/png @ 0x560091fd75c0] Terminating thread with return code -22 (Invalid argument)
- [out#0/image2 @ 0x560091fc8e40] Nothing was written into output file, because at least one of its streams received no packets.
- frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
- Conversion failed!`
Another discovery, on running ffbrobe -version
it returns "command not found" (I imagine it's also required)
ChatGPT advised I update ffmpeg, I downloaded "ffmpeg-git-amd64-static.tar.xz" from https://johnvansickle.com/ffmpeg/, but beside extracting it on the server, I don't know how to instruct shimmie to use it.
Hope this information proves useful, let me know if I omitted anything. Thank you for your time!
EDIT: I've decided to upload multiple webm files to see if the error changes. It seems I missed that the error comes in pairs, as seen here
ffbrobe -version
Well-spotted, I suspect that's the issue. Just double checking, is this just a typo ('b' instead of 'p') or does ffprobe
actually not exist on the server? (I assume the latter, because IIRC error 127 is "command not found"). ffprobe is mentioned many times in the Shimmie code so I also believe it's necessary for audio and video files, so install it and retry, checking it works on CLI with no errors.
My (naïve!) guess is ffprobe is being used to get the video's dimensions, and when this fails, the ffmpeg isn't given valid scale instructions, giving that first error: Failed to configure output pad on Parsed_scale_0
If it keeps having issues, I would try searching the individual error messages, ideally from first to last.
PS: I personally would be cautious about relying on NLPs like ChatGPT for advise. It can't understand context like outdated answers, disputes and critique of replies, etc., so it ends up just giving what it thinks is the most likely answer (in this case, the generic advise to update, which isn't harmful or anything but I don't think it would solve your problem - in this case when we might be talking about compatibility rather than missing features, if anything I would first consider downgrading it!)
Sorry, yes, it was a typo (picture related)
The existence of a disable ffprobe
command makes me think it might still exist, despite CLI not being able to find it?
Frankly, I am not sure how to downgrade it, I live under the assumption that it came pre-installed when I purchased this webhost (siteground.com, shared hosting by the looks of it).
The default install location (found with a whereis
) points towards "usr/local/bin/ffmpeg"
(which I don't have access to tamper with, via CLI or FTP). Which brings back the question I made in the previous post: if I were to manually add ffmpeg/ffprobe to say, the root folder of my site, how would I instruct shimmie to use it? I poked a bit at /ext/media/config.php
and changed the strings there, but it didn't seem to have any effect (or maybe I messed it up due to lack of know-how).
And I'm aware GPT is not the most reliable tool to use, but it helped me gain some insight about the whole ordeal, especially as a complete novice. I just didn't want to open an issue the moment I got stuck, and tried to do it on my own. Unfortunately, I think this is as far as I can go with my limited knowledge.
I wouldn't try downgrading yet, I think the problem is not ffmpeg, but that ffprobe is missing. I've never used shared hosting, so you might need to ask the siteground.com support team how to enable/install ffprobe because I am confused why only one of them would be working.
And I'm aware GPT is not the most reliable tool to use, but it helped me gain some insight about the whole ordeal, especially as a complete novice
That's fine, and I'm glad to hear you were already aware and that it helped :) I was only saying that just in case.
I wouldn't try downgrading yet, I think the problem is not ffmpeg, but that ffprobe is missing. I've never used shared hosting, so you might need to ask the siteground.com support team how to enable/install ffprobe because I am confused why only one of them would be working.
I am just as confused. I saw siteground has a built-in AI assistant, and I tried inquiring about ffprobe missing, to which I got the following answer :
I'm not sure what to believe anymore. It's weekend so I'll wait until tomorrow and try to contact someone from support directly, since I'm all out of ideas.
Thank you again for your help!
With a bit of help from a friend, we got ffprobe working (error 245 is gone, but 127 persists). He verified that the ffmpeg commands worked without issue with the amd64 7.0.1 binaries on a second machine, but the first machine continues to throw errors, namely
- Metadata:
- encoder: Lavf
- Duration: 00:00:04.00, start: 0.000000, bitrate: 601 kb/s
- Stream #0:0: Video: vp8, yuv420p(progressive), 348x632, SAR 1:1 DAR 87:158, 60 fps, 60 tbr, 1k tbn (default)
- Metadata:
- DURATION : 00:00:03.999000000
- Stream mapping:
- Stream #0:0 -> #0:0 (vp8 (native) -> png (native))
- Press [q] to stop, [?] for help
- [Parsed_thumbnail_1 @ 0x7ff410010900] frame id 34 (pts_time=0.567000) selected from a set of 100 images
- [png @ 0x83892c0] ff_frame_thread_encoder_init failed
- [vost#0:0/png @ 0x8388d80] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
- [vf#0:0 @ 0x839f500] Error sending frames to consumers: Resource temporarily unavailable
- [vf#0:0 @ 0x839f500] Task finished with error code: -11 (Resource temporarily unavailable)
- [vf#0:0 @ 0x839f500] Terminating thread with return code -11 (Resource temporarily unavailable)
- [vost#0:0/png @ 0x8388d80] Could not open encoder before EOF
- [vost#0:0/png @ 0x8388d80] Task finished with error code: -22 (Invalid argument)
- [vost#0:0/png @ 0x8388d80] Terminating thread with return code -22 (Invalid argument)
- [out#0/image2 @ 0x838de80] Nothing was written into output file, because at least one of its streams received no packets.
- frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
- Conversion failed!
It's a bit of progress, but I still don't know what causes it. I will still try to contact siteground support, while keeping an eye on here as well.
It was indeed an issue with the hosting service. I changed it and works perfectly now. Thank you again for all the help!