rodlie / qtfm

Qt File Manager
https://qtfm.eu
GNU General Public License v2.0
158 stars 46 forks source link

Video thumbnailing with cover arts #119

Closed AcarBurak closed 5 years ago

AcarBurak commented 5 years ago

Thank you for enabling video thumbnails, but qtfm (contrary to some other file managers) does not show embedded cover arts (of mkv and mp4 files) as thumbnails which is the expected behavior according to my /usr/share/thumbnailers/ffmpegthumbnailer.thumbnailer:

[Thumbnailer Entry] TryExec=ffmpegthumbnailer Exec=ffmpegthumbnailer -m -i %i -o %o -s %s

MimeType=video/jpeg;video/mp4;video/mpeg;video/quicktime;video/x-ms-asf;video/x-ms-wm;video/x-ms-wmv;video/x-ms-asx;video/x-ms-wmx;video/x-ms-wvx;video/x-msvideo;video/x-flv;video/x-matroska;application/mxf;video/3gp;video/3gpp;video/dv;video/divx;video/fli;video/flv;video/mp2t;video/mp4v-es;video/msvideo;video/ogg;video/vivo;video/vnd.divx;video/vnd.mpegurl;video/vnd.rn-realvideo;video/vnd.vivo;video/webm;video/x-anim;video/x-avi;video/x-flc;video/x-fli;video/x-flic;video/x-m4v;video/x-mpeg;video/x-mpeg2;video/x-nsv;video/x-ogm+ogg;video/x-theora+ogg

And this is my qmake config: qmake CONFIG+=with_magick CONFIG+=magick7 CONFIG+=with_ffmpeg PREFIX=/usr

rodlie commented 5 years ago

for video I assume you want a screenshot and on audio I assume you want cover art. That's at last how it work now.

This can be easily adjusted later ;)

AcarBurak commented 5 years ago

Sorry,

for video I assume you want a screenshot

no. Please see the attachment. thumb

rodlie commented 5 years ago

Try latest commit, I default to always prefer coverart first (I don't have any video files with covertart to test with).

I will also add a setting.

rodlie commented 5 years ago

you will need to clear the icon cache

AcarBurak commented 5 years ago

To clarify, I've embedded dvd cover art images to my movies and my ffmpegthumbnailer.thumbnailer thumbnails those covers (Exec=ffmpegthumbnailer -m -i %i -o %o -s %s). Doublecmd on the left shows them and qtfm doesn't –for the time being! Thanks anyway.

AcarBurak commented 5 years ago

I've just cleared the cache, but without any difference.

rodlie commented 5 years ago

Ok, I will need to get a video file with embedded coverart so I can see what fails.

AcarBurak commented 5 years ago

Well, I've compiled again and then cleared the cache, but there're no thumbnails now.

rodlie commented 5 years ago

I know, will be fixed.

rodlie commented 5 years ago

Ok, the coverart feature I added was for `` /*

AcarBurak commented 5 years ago

Sorry, I can only say how I've embedded cover arts some years ago.

For mkv movies:

mkvpropedit SHIP_OF_FOOLS.mkv --add-attachment cover.jpg

For m4v movies:

./AtomicParsley file.m4v --artwork JPEG-File.jpg --overWrite

And as for the ffmpegthumbnailer, from ffmpegthumbnailer --help:

-m : prefer embedded image metadata over video content

rodlie commented 5 years ago

I used: ffmpeg -i video.mp4 -i cover.jpg -c:a copy -c:v copy -map 0 -map 1:0 video+cover.mp4

works with latest commit, please try.

AcarBurak commented 5 years ago

Not working here.

rodlie commented 5 years ago

ok, will test mkvpropedit when I get the time and see what kind of file I get.

Would be nice with a documented standard for these kind of things :)

btw, if you run `ffprobe`` on a mkv with coverart what do you get? an extra MJPEG stream? or some other meta data related to the cover?

AcarBurak commented 5 years ago

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55edf2da94c0] stream 0, timescale not set Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'AMADEUS.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.9.100 Duration: 03:00:25.74, start: 0.000000, bitrate: 2275 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x784 [SAR 1:1 DAR 120:49], 2149 kb/s, 23.98 fps, 23.98 tbr, 27021 tbn, 47.95 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 120 kb/s (default) Metadata: handler_name : SoundHandler Stream #0:2: Video: png, rgb24(pc), 200x257 [SAR 2834:2834 DAR 200:257], 90k tbr, 90k tbn, 90k tbc

rodlie commented 5 years ago

ahh, it's a PNG. Should be easy to fix.

AcarBurak commented 5 years ago

Glad to hear that!

rodlie commented 5 years ago

should work now.

AcarBurak commented 5 years ago

Before building again, I've written a PKGBUILD and build qtfm by it and it compiles twice. Either my PKGBUILD is not right or it's normal behaviour for qtfm, second compilation is for libfm?

rodlie commented 5 years ago

please post the PKGBUILD if possible.

AcarBurak commented 5 years ago

pkgname=qtfm pkgver=1 pkgrel=1 pkgdesc="A lightweight file manager" arch=('i686' 'x86_64') url="https://github.com/rodlie/qtfm/releases" license=('GPL') depends=('qt5-base' 'desktop-file-utils' 'hicolor-icon-theme') provides=('qtfm' 'qtfm-git') conflicts=('qtfm' 'qtfm-git') sha256sums=('SKIP')

build() { rm -Rf build && mkdir build && cd build qmake CONFIG+=with_magick CONFIG+=magick7 CONFIG+=with_ffmpeg PREFIX=/usr $srcdir/$pkgname/ make }

package() { cd build make INSTALL_ROOT=$pkgdir install

rodlie commented 5 years ago

Looks ok, note that qtfm 6.2 builds with shared library as default so you either need to add LIBSUFFIX=64 if target is /usr/lib64 etc or add CONFIG+=staticlib .

AcarBurak commented 5 years ago

All right, thanks. … Waiting for the compilation to end.

rodlie commented 5 years ago

also add depends for ImageMagick and FFmpeg.

AcarBurak commented 5 years ago

I will, thanks. … But, no joy, no thumbs, sorry! Perhaps I'd better compile it manually without PKGBUILD.

rodlie commented 5 years ago

Odd...

I added a PNG to a test mkv: Stream #0:2: Video: png (MPNG / 0x474E504D), rgb24(pc), 1920x1080 [SAR 2834:2834 DAR 16:9], 1k fps, 1k tbr, 1k tbn, 1k tbc Metadata: DURATION : 00:00:00.040000000

And I get the thumbnail, but notice MPNG, your file has only PNG ..... I will need to do some reading about this, or see what ffmpegthumbnailer etc does. But I'm off to work, will look at this later tonight.