Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 23 Oct 2019, 11:09
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Rox thumbnail for video files as well as jpeg
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Author Message
Smithy


Joined: 12 Dec 2011
Posts: 1063

PostPosted: Sun 21 Oct 2018, 04:14    Post subject:  Rox thumbnail for video files as well as jpeg
Subject description: Is it possible?
 

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.
Screenshot.png
 Description   
 Filesize   31.67 KB
 Viewed   586 Time(s)

Screenshot.png


Last edited by Smithy on Sun 21 Oct 2018, 17:01; edited 1 time in total
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1214

PostPosted: Sun 21 Oct 2018, 16:14    Post subject:  

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:

#!/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:

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:

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

_________________
Fatdog64-802|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
Smithy


Joined: 12 Dec 2011
Posts: 1063

PostPosted: Sun 21 Oct 2018, 17:10    Post subject:  

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

Code:
# 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.
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1214

PostPosted: Mon 22 Oct 2018, 17:33    Post subject:  

Change VIDEO.mp4 to Earth.mp4 in the ffmpeg command.
_________________
Fatdog64-802|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1921
Location: Japan

PostPosted: Mon 22 Oct 2018, 21:53    Post subject:  

@step: Does this work for you?

The code
Code:
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?
Back to top
View user's profile Send private message 
ITSMERSH

Joined: 02 May 2018
Posts: 911

PostPosted: Tue 23 Oct 2018, 06:34    Post subject:  

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

The code
Code:
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.

_________________
RSH

Beware of the Dog ähem nic007! Wink
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1214

PostPosted: Sat 27 Oct 2018, 18:47    Post subject:  

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

The code
Code:
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.
tas-20181027.png
 Description   
 Filesize   27.91 KB
 Viewed   435 Time(s)

tas-20181027.png


_________________
Fatdog64-802|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
fabrice_035


Joined: 28 Apr 2014
Posts: 642
Location: Bretagne / France

PostPosted: Sun 28 Oct 2018, 05:05    Post subject:  

Hello,

Native option in Rox work fine.

http://i65.tinypic.com/a2raj6.jpg

http://i65.tinypic.com/2duijkl.jpg

_________________
xenialpup 7.5 / Linux Kernel: 4.4.95 / Window Manager: JWM v2.3.7
Back to top
View user's profile Send private message 
ITSMERSH

Joined: 02 May 2018
Posts: 911

PostPosted: Sun 28 Oct 2018, 07:30    Post subject:  

Quote:
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?

_________________
RSH

Beware of the Dog ähem nic007! Wink

Last edited by ITSMERSH on Sun 28 Oct 2018, 09:03; edited 1 time in total
Back to top
View user's profile Send private message 
ITSMERSH

Joined: 02 May 2018
Posts: 911

PostPosted: Sun 28 Oct 2018, 09:02    Post subject:  

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.

_________________
RSH

Beware of the Dog ähem nic007! Wink
Back to top
View user's profile Send private message 
fabrice_035


Joined: 28 Apr 2014
Posts: 642
Location: Bretagne / France

PostPosted: Sun 28 Oct 2018, 09:20    Post subject:  

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:
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/

_________________
xenialpup 7.5 / Linux Kernel: 4.4.95 / Window Manager: JWM v2.3.7
Back to top
View user's profile Send private message 
ITSMERSH

Joined: 02 May 2018
Posts: 911

PostPosted: Sun 28 Oct 2018, 10:02    Post subject:  

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.

_________________
RSH

Beware of the Dog ähem nic007! Wink
Back to top
View user's profile Send private message 
ITSMERSH

Joined: 02 May 2018
Posts: 911

PostPosted: Sun 28 Oct 2018, 12:29    Post subject:  

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. Very Happy

That's pretty cool! Cool
Screenshot-2018-10-28-18-17-38.jpg
 Description   
 Filesize   78.76 KB
 Viewed   326 Time(s)

Screenshot-2018-10-28-18-17-38.jpg


_________________
RSH

Beware of the Dog ähem nic007! Wink
Back to top
View user's profile Send private message 
a_salty_dogg


Joined: 15 Dec 2013
Posts: 181

PostPosted: Sun 28 Oct 2018, 22:58    Post subject:  

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! Very Happy
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13352
Location: Arizona USA

PostPosted: Sun 28 Oct 2018, 23:25    Post subject:  

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.
Rox video thumbnails.png
 Description   
 Filesize   101.35 KB
 Viewed   300 Time(s)

Rox video thumbnails.png

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0950s ][ Queries: 12 (0.0244s) ][ GZIP on ]