GNOME Bugzilla – Bug 134366
Launch Videos with External Viewer
Last modified: 2007-02-21 18:10:34 UTC
It would be nice to see videos in the thumbnail view. Nautilus can make thumbnails of these files--not sure how difficult adding it would be--but merely displaying an icon would be fine. I wouldn't expect gThumb to actually play them, but launching them to the default gnome viewer would be great. When I take short movies with my camera, I'd like it all to remain one distinct collection (pics, movies, sound), especially when I burn to CD or make a web photo album. Thank you!
This would be great. Even if it just showed the first frame for now, it'd help a lot. I'd vote for this if I could!
I was just thinking of the same thing, although also worry about the kitchen sink mentality.
I don't believe this would be a case of bloat at all. Simply launching an external viewer ads very little code. Grabbing the thumbnails is likely more involved, but since it's already a function of Nautilus might not be that bad. As I said, the program doesn't need to play them internally (though even this needn't add much with bonobo/totem or something).
I also vote for this one. With recent cameras, photos and videos are all mixed in one collection. Being able to see a thumbnail of the videos, or (better) being able to play them would be really neat.
Patches welcome! I want to look at this some day, but I'm working on other bugs right now (VFS support, RAW support, etc). It "shouldn't be too hard" to add this feature. I'd be happy to look at any patches that are submitted... - Mike
There's code to open with the default movie player in totem/browser-plugin/totem-plugin-viewer.c, that can just be cut'n'pasted.
Thanks, Bastien, I'll look at that. What actually stopped me last time I looked at this was figuring out what prevented AVI files from being shown in the file listings in gthumb. Paolo, any hints on that? What is performing the file-type-filtering? - Mike
the filter is performed by load_new_list in libgthumb/gth-file-list.c
Thanks, I'll look at adding this to the vfs-testing branch. Is there a gnomish way to generate a thumbnail (i.e. the first frame) of a video? I'm sure something can be done with mencoder or other tools... - Mike
Never mind. I just found totem-video-thumbnailer. - Mike
Use GnomeThumbnail and the GnomeThumbnailFactory. See http://developer.gnome.org/doc/API/2.0/libgnomeui/libgnomeui-GnomeThumbnail.html
(In reply to comment #10) > Never mind. I just found totem-video-thumbnailer. You shouldn't use it directly. GnomeThumbnail will take care of figuring out which items need to be thumbnailed, depending on mime-type.
Paolo, I've committed a new revision to vfs-testing that adds video thumbnailing and playback. It's pretty rough, but it does work (even over VFS!). The thumbnailing works, although my mime-checking routines are inefficient (file_is_image, file_is_video) - I can fix that. The tricky part for me is launching the external video viewer. I've written it so that if there are any video files in the listed of selected thumbnails, the list of video files is dumped to totem (to play sequentially). I don't know if you'll like that. The list of files could contain a variety of video mimetypes (in theory), so dumping the list to totem and letting totem figure everything out is appealing. I don't know if there is a better (less hard-coded) way of calling a default video viewer to show a variety of videos (of different types) in sequence. It's probably beyond my coding ability. Anyway... change whatever you like... - Mike
I just noticed that clicking in a browser view works to launch the video(s), but using prev/next in the image view mode doesn't. I'll have to look at that... like I said, it's still pretty rough. - Mike
I've tweaked the code to show a video thumbnail in both the browser and viewer modes. Pressing "enter" will launch totem in either mode. (You can only get to the viewer mode thumbnail by launching viewer mode with an image, then using next/prev to get to the video). I'm having one problem: in the viewer mode, I try to load an existing video thumbnail using gnome_thumbnail_factory_lookup (at line 625 of image-loader.c in the vfs-testing branch), but this is always returning NULL, forcing a re-creation of the thumbnail (which is slow). What am I doing wrong? There is an existing thumbnail in .thumbnails. - Mike
I figured out my thumbnailing problem - different thumbnail sizing. - Mike
Initial support for viewing videos (using totem) is present in svn trunk now. - Mike
Wonderful, thank you very much! :-)
*** Bug 326057 has been marked as a duplicate of this bug. ***
Paolo, You've modified the player launch code to use default players, which is good, but we've lost the ability to play more than one video file in sequence. That's a feature I like (well, my kids like it...) Do you think it would be a good idea to check the application that the "current" video needs, and play all selected items that need the same application? I can code that in if you don't oppose it. - Mike
Well, I've gone ahead and added that. Works nicely. - Mike