Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Howto: Video Thumbnails for .BIN & .RM Files.

  1. #1
    Join Date
    Aug 2006
    Location
    tuesday
    Beans
    6,502
    Distro
    Kubuntu Development Release

    Talking Howto: Video Thumbnails for .BIN & .RM Files.

    Ok before I begin this is kind of a nasty hack, and by that I mean I associate thumbnailing for the application/octet-stream mimetype to pull this off. Meaning this will use mplayer to general *attempt* to make thumbnails from any file with that mimetype. Which can have interesting side effects to say the least... Examples below.

    Unfinished rar files for a movie from a torrent:


    Random SMC snes roms:



    If you're ok with this and don't care, go ahead and read on. (or just remove this section and only install thumbnailing for RM videos)

    First I have to thank minio for his HowTo on OpenOffice thumbnails http://ubuntuforums.org/showthread.php?t=76566, which showed me exactly what I needed to know to get this started.

    And me2030581 for his mplayer thumbnailing script. Since gnome uses totem i believe (or xine depending on your setup) to create video thumbnails, thumbnailing bin files (and possibly RM files but i'm not sure on this one) isn't supported since it can't play these file types.

    Dependencies
    mplayer
    mogrify
    gconf-editor
    make sure you have these installed (you probably should, but just incase) or this will fail worse than a flying sheep.

    Here goes:

    Code:
    cd ~
    wget http://me2030581.googlepages.com/mplayer-video-thumb-0.1beta.tar.bz2
    tar -xvjf mplayer-video-thumb-0.1beta.tar.bz2
    cd mplayer-video-thumb-0.1beta/
    chmod 755 mplayer-video-thum.sh
    sudo mv mplayer-video-thum.sh /usr/bin
    sudo mkdir /usr/share/apps/videothumbnail/
    sudo mv *.png /usr/share/apps/videothumbnail/
    now that the mplayer thumbnailer script is installed we start with the gconf-editor side of things

    Code:
    sudo gedit /usr/share/gconf/schemas/bin-rm_thumb.schemas
    once gedit is opened you will need to paste the following:

    Code:
    <gconfschemafile>
        <schemalist>
    
            <schema>
                <key>/schemas/desktop/gnome/thumbnailers/application@octet-stream/enable</key>
                <applyto>/desktop/gnome/thumbnailers/application@octet-stream/enable</applyto>
                <owner>ooo2-thumb</owner>
                <type>bool</type>
                <default>true</default>
                <locale name="C">
                    <short></short>
                    <long></long>
                </locale>
            </schema>
    
    
            <schema>
                <key>/schemas/desktop/gnome/thumbnailers/application@octet-stream/command</key>
                <applyto>/desktop/gnome/thumbnailers/application@octet-stream/command</applyto>
                <owner>ooo2-thumb</owner>
                <type>string</type>
                <default>/usr/bin/mplayer-video-thum.sh -s %s %u %o</default>
                <locale name="C">
                    <short></short>
                    <long></long>
                </locale>
            </schema>
    
            <schema>
                <key>/schemas/desktop/gnome/thumbnailers/application@vnd.rn-realmedia/enable</key>
                <applyto>/desktop/gnome/thumbnailers/application@vnd.rn-realmedia/enable</applyto>
                <owner>ooo2-thumb</owner>
                <type>bool</type>
                <default>true</default>
                <locale name="C">
                    <short></short>
                    <long></long>
                </locale>
            </schema>
    
    
            <schema>
                <key>/schemas/desktop/gnome/thumbnailers/application@vnd.rn-realmedia/command</key>
                <applyto>/desktop/gnome/thumbnailers/application@vnd.rn-realmedia/command</applyto>
                <owner>ooo2-thumb</owner>
                <type>string</type>
                <default>/usr/bin/mplayer-video-thum.sh -s %s %u %o</default>
                <locale name="C">
                    <short></short>
                    <long></long>
                </locale>
            </schema>
    
        </schemalist>
    </gconfschemafile>
    I havn't as you can see changed the owner string from the template I made out of minio's information from ooo2-thumb, but I don't believe this causes any horrible conflict.

    Save the file and get your happy butt back to that terminal.

    Code:
    gconftool-2 --install-schema-file /usr/share/gconf/schemas/bin-rm_thumb.schemas
    killall -9 nautilus
    With that done you should be able after nautilus restarts, goto the folder(s) where you keep you BIN vcds and or RM video files and see them being thumbnailed. You may need to hit F5 to refresh the window for the change to take effect. In a couple cases I needed to rename a file to the process started, but I'm guessing that has something to do with the nautilus caches it's thumbnails.

    Hopefully this works for anyone interested. If there are any problems, please let me know so I can update this howto.

    --Aaron

    all references to canada, cows, billy corgan, polar bears, ect.; living or dead are purely coincidential. also random fits of confusion, anger, loss of purpose, and/or canada; may be blamed on you...in which case you will be killed in the slowest possible way while watching the sexual organs of any of your close friends be unwillingly fed to large satanic carebears. all comments dealing with the non-existance of god are to be taken as fact unless otherwise proven by written notice/birth certificate. you may be castrated in the state of neveda for molesting small children. throwing lit candles at large bulls may be hazardous to your health, unless of course you are dead....then the proceeding statement is null and void.
    Last edited by hikaricore; October 16th, 2006 at 10:44 AM.

  2. #2
    Join Date
    Aug 2006
    Location
    tuesday
    Beans
    6,502
    Distro
    Kubuntu Development Release

    Re: Howto: Video Thumbnails for .BIN & .RM Files.

    **update 10/16** just fixed a few serious typos lol **update**

    **update 10/17** Note this can also be used to thumbnail almost any file type mplayer can play, where the gnome thumbnailer drops dead on some files this can shine. If you add the appropriate mime types to the schemas file you can thumbnail almost anything.
    Last edited by hikaricore; October 17th, 2006 at 05:25 PM.

  3. #3
    Join Date
    Sep 2005
    Location
    Marysville, WA
    Beans
    76
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Talking Re: Howto: Video Thumbnails for .BIN & .RM Files.

    Quote Originally Posted by hikaricore View Post
    **update 10/16** just fixed a few serious typos lol **update**

    **update 10/17** Note this can also be used to thumbnail almost any file type mplayer can play, where the gnome thumbnailer drops dead on some files this can shine. If you add the appropriate mime types to the schemas file you can thumbnail almost anything.

    Excellent post! Thanks...

  4. #4
    Join Date
    May 2006
    Location
    India
    Beans
    514
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Howto: Video Thumbnails for .BIN & .RM Files.

    Can you please tell me how to get thumbnails of rmvb files using this method? I am kind of confused about that.
    The way I have been doing it so far is to open the directory containing the files in Konqueror. Konqueror generates thumbnails for it. Then I have the thumbnails in nautilus as well.

  5. #5
    Join Date
    Aug 2006
    Location
    tuesday
    Beans
    6,502
    Distro
    Kubuntu Development Release

    Re: Howto: Video Thumbnails for .BIN & .RM Files.

    Quote Originally Posted by chocbar31 View Post
    Excellent post! Thanks...
    You're quite welcome

    Quote Originally Posted by Sukarn View Post
    Can you please tell me how to get thumbnails of rmvb files using this method? I am kind of confused about that.
    The way I have been doing it so far is to open the directory containing the files in Konqueror. Konqueror generates thumbnails for it. Then I have the thumbnails in nautilus as well.
    I would need to know the mimetype so I could write a modified .schemas file, but if you can get me that info I wouldn't mind trying.

  6. #6
    Join Date
    Nov 2006
    Beans
    213
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Video Thumbnails for .BIN & .RM Files.

    Just tried this and I get RMVB thumbnails just as is!

  7. #7
    Join Date
    Mar 2006
    Beans
    3

    Re: Howto: Video Thumbnails for .BIN & .RM Files.

    Thanks for your information...I found a bug which did not support chinese path/file very well. and i modify the scripts as follow:

    Code:
    #!/bin/bash 
    file="$3"
    file=`uri-unescape.pl $file`
    cd /tmp
    LENGTH=$(mplayer -nocache  -identify -vo null -ao null -frames 0 "$file"  | awk -F= '/ID_LENGTH/ {print $2}'| awk -F. '{print $1}')
    START=$((($LENGTH*15)/100))
    END=$((($LENGTH*70)/100))
    start=$(($START+($RANDOM%($END-$START+1))))
    /usr/bin/mplayer -nocache -vf scale -vo jpeg -ao null -ss "$start" -frames 4 "$file"
    rm -f 00000001.jpg 00000002.jpg 00000003.jpg
    /usr/bin/mogrify -resize "$2" -draw 'image Over 0,0 10,100  "/usr/share/apps/videothumbnail/filmholes-big-left.png"' -draw 'image Over 118,0 10,100 "/usr/share/apps/videothumbnail/filmholes-big-right.png"' 00000004.jpg  
    cd -
    mv  /tmp/00000004.jpg "$4"
    please note line 3 (I modify this line only), i use URI::Escape module of perl to unescape the filename. and following is script uri-unescape.pl

    Code:
    #!/usr/bin/perl
    use URI::Escape;
    $text = $ARGV[0];
    print uri_unescape($text);
    I know little about perl, and didn't how to combine the uri-unescape.pl with the mplayer-video-thum.sh..........I hope someone can help me out.

    p.s. if you want re-generate the thumbnails, you should delete the files under ~/.thumbnails/fail/gnome-thumbnail-factory
    Last edited by zigzed; March 1st, 2007 at 04:26 AM.

  8. #8
    Join Date
    May 2008
    Location
    /home/fxtrem
    Beans
    11
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Howto: Video Thumbnails for .BIN & .RM Files.

    I've made a little patch to support some accented characters (Most of them used by PT_BR language)

    Type this on the terminal:
    Code:
    sudo gedit /usr/bin/mplayer-video-thum.sh
    Then change this line

    Code:
    (...)
    file="$3"
    file=$(echo "$file" | sed -e 's/%20/ /g' | sed -e 's/%26/\&/g' | sed -e 's/%5B/\[/g' | sed -e 's/%5D/\]/g' | sed -e 's/%40/\@/g' )
    cd /tmp
    (...)
    With this:
    Code:
    file=$(echo "$file" | sed -e 's/%20/ /g' | sed -e 's/%26/\&/g' | sed -e 's/%5B/\[/g' | sed -e 's/%5D/\]/g' | sed -e 's/%40/\@/g' | sed -e 's/%C2%AA/ª/g' | sed -e 's/%C3%BA/º/g' | sed -e 's/%C2%B0/°/g' | sed -e 's/%C3%A1/á/g' |sed -e 's/%C3%A9/é/g' | sed -e 's/%C3%AD/í/g' | sed -e 's/%C3%B3/ó/g' | sed -e 's/%C3%BA/ú/g' | sed -e 's/%C3%81/Á/g' | sed -e 's/%C3%89/É/g' | sed -e 's/%C3%8D/Í/g' | sed -e 's/%C3%93/Ó/g' | sed -e 's/%C3%9A/Ú/g' | sed -e 's/%C3%A3/ã/g' | sed -e 's/%C3%83/Ã/g' | sed -e 's/%3F/?/g' | sed -e 's/%C3%A2/â/g' | sed -e 's/%C3%AA/ê/g' | sed -e 's/%C3%B4/ô/g' | sed -e 's/%C3%82/Â/g' | sed -e 's/%C3%8A/Ê/g' | sed -e 's/%C3%94/Ô/g')

  9. #9
    Join Date
    Oct 2008
    Beans
    1

    Re: Howto: Video Thumbnails for .BIN & .RM Files.

    Someone can post how to apply this to .rmvb movies? I have tried it but it has been a failure

    I'm using intrepid ibex.
    Last edited by zyfnab; October 12th, 2008 at 01:57 AM.

  10. #10
    Join Date
    Nov 2006
    Beans
    213
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Video Thumbnails for .BIN & .RM Files.

    I haven't tried this on an intrepid installation yet but I intend to today, I will let you know how I get on with rmvb.
    HTPC:EP45-UD3R Q6600, 8Tb , 4 Gb DDR2 800, GF 7100GT, PVR 500 Tuner, Firefly rf. Server:Ubuntu P35C-DS3R, Q6600, 6Tb, 8 Gb DDR2 800, Asus 8600GT,Ubuntu:TF7025-M2, AMD x2 5000+ BE, 4 Gb DDR2 800, 500Gb , NV 7025 Xubuntu: eeePC 701, 8GB SSD, 2GB DDR2.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •