Rox thumbnail for video files as well as jpeg

Filemanagers, partitioning tools, etc.
Message
Author
User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

Rox thumbnail for video files as well as jpeg

#1 Post by Smithy »

Is it possible to have Rox show a thumbnail when one browses videos on your drive? Picture previews show up fine.
Attached a screenshot of what I mean, the video just shows that standard icon, but the jpg pic shows a mini thumbnail.
Attachments
Screenshot.png
(31.67 KiB) Downloaded 779 times
Last edited by Smithy on Sun 21 Oct 2018, 21:01, edited 1 time in total.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#2 Post by step »

Yes, but YMMV according to the versions of rox and ffmpeg that are installed in your Pup. I can only describe what works for Fatdog64. Hopefully, it will work for your case, too. Another thing to keep in mind is that the thumbnail will be randomly chosen from the video stream. You won't get to pick your favorite frame.

Credits: SFR, jamesbond

So, create file /etc/xdg/rox.sourceforge.net/MIME-thumb/video_mp4 with the following content

Code: Select all

#!/bin/sh
# $1-path to source, $2-path to output, $3-pixel size 

# note: ffmpeg has -vf "thumbnail" filter,  but it's said to often return
# blank frames. "-ss" takes the video from somewhere in the middle of the video.
exec ffmpeg -ss 10 -i "$1" -vframes 1 -filter:v scale="$3:-1" "$2"
Download an mp4 video. Open the folder where you saved the video. Now rox should show a thumbnail for the video.

In case it doesn't... Troubleshooting:
Open a terminal window in the folder where the mp4 video file is saved. Type

Code: Select all

rox -m VIDEO.mp4
replacing VIDEO with the file name of your video.
It should return "video/mp4" (without quotes). If it says something else then the system detects some media types incorrectly and you'll need to fix that (beyond the scope of this answer).

Yes, it says "video/mp4" but still no thumbnail... Troubleshooting:
Open a terminal window in the folder where the mp4 video file is saved. Type

Code: Select all

ffmpeg -ss 10 -i VIDEO.mp4 -vframes 1 -filter:v scale="128:-1" VIDEO.jpg
replacing VIDEO with the file name of your video.
This should create a thumbnail in the current folder. If it doesn't or you get errors from ffmpeg you will need to investigate those (beyond the scope of this answer).

How to show thumbnail for other video types:
Say you have VIDEO.mpeg, determin its MIME type (with rox -m). Let's assume it's "video/mpeg". Then you need to create a link from file
/etc/xdg/rox.sourceforge.net/MIME-thumb/video_mpeg
to file
/etc/xdg/rox.sourceforge.net/MIME-thumb/video_mp4
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#3 Post by Smithy »

Thanks for the structured reply Step.
I got as far as this:

Code: Select all

# rox -m Earth.mp4
video/mp4
# ffmpeg -ss 10 -i VIDEO.mp4 -vframes 1 -filter:v scale="128:-1" Earth.jpg 
ffmpeg version 2.8.13 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.1 (Ubuntu 5.4.1-8ubuntu1) 20170304
  configuration: --prefix=/usr --libdir=/usr/lib --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-pthreads --enable-small --enable-postproc --enable-libvorbis --enable-gpl --enable-shared --enable-nonfree --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-debug --enable-bzlib --enable-zlib --enable-libspeex --enable-version3 --enable-runtime-cpudetect --enable-x11grab --enable-libschroedinger --enable-libtheora --enable-libxvid --enable-swscale --enable-libvpx
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
VIDEO.mp4: No such file or directory
I think I might go back to trying a pristine boot without openbox (just jwm) just to see if I have introduced any "difficulties", before attempting to get the thumbnail preview functioning. Thanks.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#4 Post by step »

Change VIDEO.mp4 to Earth.mp4 in the ffmpeg command.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#5 Post by MochiMoppel »

@step: Does this work for you?

The code

Code: Select all

exec ffmpeg -ss 10 -i "$1" -vframes 1 -filter:v scale="$3:-1" "$2"
works as expected and creates a thumbnail with a name like /root/.thumbnails/normal/92ede141d3c298246b265c05c9f413fb.png. This PNG file looks fine and is not different from other PNG thumbnails created by ROX-Filer's internal thumbnail creator, but ROX-Filer would not use it as a file icon. What's wrong here?

ITSMERSH

#6 Post by ITSMERSH »

MochiMoppel wrote:@step: Does this work for you?

The code

Code: Select all

exec ffmpeg -ss 10 -i "$1" -vframes 1 -filter:v scale="$3:-1" "$2"
works as expected and creates a thumbnail with a name like /root/.thumbnails/normal/92ede141d3c298246b265c05c9f413fb.png. This PNG file looks fine and is not different from other PNG thumbnails created by ROX-Filer's internal thumbnail creator, but ROX-Filer would not use it as a file icon. What's wrong here?
Equal experience here. Lots of video thumbnails /root/.thumbnails/normal, but the video files still displaying the default video48.png.

Equal results also with the /etc/xdg/rox.sourceforge.net/MIME-thumb/video_mp4 file (also by the video_mpg link). It produces the thumbnails but that's all - nothing else changed on displaying the video files.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#7 Post by step »

MochiMoppel wrote:@step: Does this work for you?

The code

Code: Select all

exec ffmpeg -ss 10 -i "$1" -vframes 1 -filter:v scale="$3:-1" "$2"
works as expected and creates a thumbnail with a name like /root/.thumbnails/normal/92ede141d3c298246b265c05c9f413fb.png. This PNG file looks fine and is not different from other PNG thumbnails created by ROX-Filer's internal thumbnail creator, but ROX-Filer would not use it as a file icon. What's wrong here?
Yes it does on Fatdog64 pre800. See the attached screen capture, which shows rox thumbs in a folder - second thumb from the top left is for toystory.mp4 - and viewnior in the front displaying the same thumb fished out of ~/.cache/thumbnails/normal. I haven't tested any combination of OS and rox version but this one. Since version 710 Fatdog64 runs june7's rox builds not woofCE's. Perhaps that's what makes the difference.
Attachments
tas-20181027.png
(27.91 KiB) Downloaded 640 times
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#8 Post by fabrice_035 »

Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

ITSMERSH

#9 Post by ITSMERSH »

Native option in Rox work fine.
I can't change any settings on the video thumbnails, as there is some programs missing by Rox:

Needs to be installed from: http://0install.net/install-linux.html

Could be downloaded via Package Manager also.

Message about missing programs appearing in Tahr Puppy and Aardvark Puppy - checked these two Puppies only atm.
Though, those programs not being installed by default seems to be a possible WoofCE issue?
Last edited by ITSMERSH on Sun 28 Oct 2018, 13:03, edited 1 time in total.

ITSMERSH

#10 Post by ITSMERSH »

After downloading and installing the Zero Install packages via package manager
it complains about a missing ROX-Lib2.
Not to be found in repositories. Couldn't find either on the web.

Seems to be definitely a Job for the WoofCE Team to fix/update
Rox Filer to have video thumbnails.

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#11 Post by fabrice_035 »

In Puppy Packet Manager, click on Configure Packet Manager
In Choose repositories, select ALL. In Update database click on Update now
The PPM restart, now search "zero" , choose zeroinstall-injector_2.10-2 and click on Auto install.
If it's ok check in PPM if you have or install :

- mplayer
- python-gtk2

Exit PPM

Now, into main puppy Menu / Setup Menu select 0install and add Uri

Code: Select all

http://rox.sourceforge.net/2005/interfaces/ROX-Lib
Choose Download.

Next, you need copy in /usr/local/lib (my choice) or /root/lib or /usr/lib the ROX-Lib2* folder (*use file finder, it's in /var/cache/0install.net/...)

Normaly now the Video thumbnails option work.

* Tested with fresh Xenialpup 7.5 *

If you have a trouble open xerrs.log in /tmp/
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

ITSMERSH

#12 Post by ITSMERSH »

Ok.

I found ROX-Lib2 here (it's a RoxApp using Python): http://rox.sourceforge.net/desktop/ROX-Lib.html

Placed it into /usr/lib.

After setting up the video thumnail options I got thumbnails for .mpg and .mp4. Thumbs for .webm dosn't work.

@fabrice_035

Thanks for the info.

Since I'm running in RAM only generally, all my installs and setups on this are temporarily. I'm now going to put all of the installed files into a .sfs to repeat what I've done and to make sure it all works before doing a remaster.

If anything goes wrong I'll return to try your suggestions.

ITSMERSH

#13 Post by ITSMERSH »

Ok.

After creating a .sfs module repeated all steps and it worked.
Though, it took three attempts to get this all into a remaster working out of the box.

Successful so far in my Studio2Go (Remaster of Smithy's first Music2Go-Artful).

Now I'm going to build this into my LazY Puppy Art Studio (a remaster of a T.O.P.L.E.S.S. Tahr 6.0.2 with a few useful new N.E.M.E.S.I.S. functions). Should be a lot easier, since I know now what's the faults I'd made.

Btw: thumbs for .webm is now working as well.

Thanks to all those contributed to this topic/issue. :D

That's pretty cool! 8)
Attachments
Screenshot-2018-10-28-18-17-38.jpg
(78.76 KiB) Downloaded 506 times

User avatar
a_salty_dogg
Posts: 180
Joined: Sun 15 Dec 2013, 19:08

#14 Post by a_salty_dogg »

This is great! Been looking for this feature for some time, so many thanks to all who contributed to the thread and shared their knowledge!

So far successfully installed in Tahr 6.06 and Xenial 7.06.

Used a combination of fabrice_035's and ITSMERSH's methods; the only deviation needed was that the system initially didn't want to recognise the existence of "ROX-Lib2" since it had extracted into a folder "usr/lib/rox-lib2-2.0.6", which is not one of the locations where Zero Install looks for it, but symlinking the file to "usr/lib" soon fixed that!

Also took a little persuasion to get thumbnails to display on .flv and .webm files; had to re-associate those 2 MIME types (by dragging their icons to "Manage MIME type" window) and "delete thumbnail cache" a couple of times until eventually all worked!

Old Dogg has a new toy to play with! :D

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#15 Post by Flash »

Hmm. I just made a few videos with a digital camera. In UPupCC18.10+1 UEFI, the video files show up as .AVI files in Rox and right below each .AVI file is its corresponding .THM thumbnail file. I didn't have to do a thing to make that happen.
Attachments
Rox video thumbnails.png
(101.35 KiB) Downloaded 489 times

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#16 Post by Argolance »

Bonjour,
I had done the same thing on ToOpPy, without however needing to install zero-injector (which seems to be useful only to get ROX-Lib2) but by installing python-gtk, mplayer (which is used to generate video thumbnails - might be Totem) simply from the PPM and manually copying ROX-Lib2 to /usr/lib.

I had also found two small Rox applications (usr/local/apps) allowing to install type handlers, manage MIME types and thumbnails cache directories. As far as I know, this works fine running Puppy Precise and TahrPup but don't with Puppy Stretch and probably some other recent Puppies: python complains about some deprecated stuffs but I am sure this could be easily updated by a python connoisseur! Obviously, these 2 Rox applications (video_thumbs-181116.pet) can be executed directly from Rox: right click on an empty area of a Rox window/Options/Thumbnails...

Cordialement.
Attachments
video_thumbs-181116.pet
+ desktop MENU entry file.
(76.58 KiB) Downloaded 355 times
181117_164013_618x656_easyshot.jpg
(86.09 KiB) Downloaded 465 times
181117_160353_761x255_easyshot.jpg
(116.55 KiB) Downloaded 472 times
Last edited by Argolance on Sat 17 Nov 2018, 16:59, edited 2 times in total.

ITSMERSH

#17 Post by ITSMERSH »

Hi Argolance.

The Image 181117_164013_618x656_easyshot.jpg shows Tooppy Linux multiple times in background of the Rox filer window.

I would like to add such to my Puppy, so would you please let us know, how did you get this?

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#18 Post by Argolance »

ITSMERSH wrote:I would like to add such to my Puppy, so would you please let us know, how did you get this?
:arrow: http://rox.sourceforge.net/desktop/node/181

ITSMERSH

#19 Post by ITSMERSH »

Thanks.

Gave it a quick shot, using /root/.gtkrc.mine to define the background image for Rox filer window.

Worked immediately! :)

Now need to refine the image for a permanent version...
Attachments
Screenshot-2018-11-18-03-00-21.jpg
(43.88 KiB) Downloaded 412 times

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

Works under Xenialpup64

#20 Post by mikeslr »

Hi Argolance,

Thanks for the pet. I followed your instructions from here: http://murga-linux.com/puppy/viewtopic. ... 11#1010411. prior to installation pfind indicated that python-gtk was already present --whether builtin or added by something I had already installed. I also installed ROX-Lib2 from link ITSMERSH provided. IIRC, there were several builds. I chose the latest which, BTW, was 9 years old. It's packaged as a Rox-App*, but contains only python files*. As such, it is "no-arch". Similarly, your pet also does not contain binaries or libraries --just python files and files relating to them. Consequently, once the dependencies are met your app should run under both 32 and 64 bit systems. At any rate, it ran under Xenialpup64.

I did, however, have to install mplayer via Xenialpup64's Puppy Package Manager. [With dependencies (2?) it weighed in at less than 1 Mb].

Puppies not using Rox. From experience, I know that applications packaged as Rox-Apps can be used in the absence of Rox by clicking or calling its "executable". And while I suspect that python "modules" packaged as Rox-Apps could be used I don't know enough about python to even guess how.

Post Reply