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

Thread: HOWTO: Access files within rar without extracting (perfect for video streaming)

  1. #1
    Join Date
    Sep 2007
    Location
    Sweden
    Beans
    21
    Distro
    Gutsy Gibbon Testing

    HOWTO: Access files within rar without extracting (perfect for video streaming)

    This is a guide on how to grab files inside a rar archive without actually extracting them (perfect for video streaming)
    Disclaimer: I'm not responsible for your system, everything in here is done by you and you're responsible for the things that might happen to your system.
    Comments on how to make this guide better is very welcome, since I'm not all that good on user permits and these commands might compromise your system security (although I'm almost 100% it shouldn't).

    Get the required packages (note that fuse-utils probably already is installed)
    Code:
    sudo apt-get install subversion automake1.9 fuse-utils libfuse-dev
    Get the source code for our main attraction rarfs, which is a virtual filesystem based on fuse
    Code:
    svn co https://rarfs.svn.sourceforge.net/svnroot/rarfs/trunk/rarfs/ rarfs
    Lets build that code!
    Code:
    cd rarfs
    ./configure
    make
    sudo make install
    Since fusermount comes pre-installed as root-only, we need to change group owner and execution permits.
    First off, add your user to the "fuse" group.
    NOTE: The user need to relog to update it.
    Code:
    sudo adduser <user> fuse
    Next up, make the group "fuse" owner on these fukes so we can access them.
    Code:
    sudo chgrp fuse /dev/fuse
    sudo chgrp fuse /bin/fusermount
    Make fusermount command available to users
    Code:
    sudo chmod u+s /bin/fusermount
    Now try
    Code:
    mount.fuse rarfs#/location/of/.rar/file /my/mount/dir
    If no errors appear, you're all set!

    You can unmount your rars by typing
    Code:
    fusermount -u /my/mount/dir
    Here's a basic script that I'm using to just right click those .rar files and stream them directly.
    Code:
    #!/bin/sh
    DIR=/home/`whoami`/rar.mount/
    mount.fuse rarfs#$1 $DIR
    gmplayer -fs -zoom $DIR`ls $DIR`
    fusermount -u $DIR
    Good luck!

    Edit 1: Fixed typos and such.
    Last edited by andreeh; October 25th, 2007 at 12:44 PM.

  2. #2
    Join Date
    Sep 2006
    Beans
    2

    Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    very good tutorial ... Works Perfect under linux...

    Just a question...

    I mounted a rar Archive to a Folder /media/sda1/rardrive
    and i also added this Folder in smb.conf ...

    But its not accessible... It keeps on asking the password if an archive is mounted ..
    if i umount the archive .. i can access the Empty Folder

  3. #3
    Join Date
    Dec 2007
    Beans
    6
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    thanks for help but i cant understand how to mount multiple rar archive ?

  4. #4
    Join Date
    Dec 2007
    Beans
    6
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Talking Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    Quote Originally Posted by hardik123 View Post
    thanks for help but i cant understand how to mount multiple rar archive ?
    thanks its now work with multiple archive also

    but may be your script not mount and play file #!/bin/sh

  5. #5
    Join Date
    Dec 2007
    Beans
    6
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    I found the way just add script copy in terminal
    Code:
    gedit ~/.gnome2/nautilus-scripts/Mount
    and past this code change path as your this add mount to your rar in right click menu and play on player you like
    Code:
    #!/bin/sh
    DIR=/home/'your name'/Desktop/rar
    mount.fuse rarfs#$1 $DIR
    Save and close the gedit window, and then execute the following command to make the script executable:
    Code:
    chmod u+x ~/.gnome2/nautilus-scripts/Mount
    For unmont
    Code:
    gedit ~/.gnome2/nautilus-scripts/Unmount

    This will add Unmount script add in right click
    Code:
    #!/bin/sh
    DIR=/home/hardik/Desktop/rar
    fusermount -u $DIR
    Save and close the gedit window, and then execute the following command to make the script executable:
    Code:
    chmod u+x ~/.gnome2/nautilus-scripts/Unmount

  6. #6
    Join Date
    Aug 2007
    Location
    Off the Alaskan Coast
    Beans
    794
    Distro
    Ubuntu Development Release

    Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    If you want to view and stream avi's from inside rar's..Just use VLC Player.
    FIC K8-800T AMD64 3200+ 2GB PC3200 GeForce 6800GT Mandriva 2010 KDE+Compiz+Emerald
    MSI K9N2GM AMD 9950BE 4GB DDR2-800 GeForce 8200 10.10 WUSB600N
    Acer 6920 Core 2 Duo 4GB GeForce 9500GS 10.04 Ubuntu User #17586

  7. #7
    Join Date
    Mar 2007
    Beans
    35

    Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    Very useful thanks!
    There is a segfault on some rar's and here is the fix.
    http://bugs.gentoo.org/attachment.cg...03&action=diff
    Code:
    	
    char buf[4];
    file->read(buf,3);
    
    //for some rar files there are seeks past file end, then directly to file end
    //which makes file->good() return true, but there is nothing to read
    //so with file->gcount() we check if we actually read something
    //otherwise we use old bufer and crash somewhere
    
    if(file->gcount()==0)
    break;
    file->seekg (-3, std::ios::cur);				switch( buf[2] )

  8. #8
    Join Date
    Nov 2007
    Beans
    19
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    This is how you get it working in openSUSE:

    Get the required packages. Only one missing for me on openSUSE 11.2.
    Code:
    sudo zypper install fuse-devel
    Grab rarfs-0.0.8.tar.gz or newer from http://sourceforge.net/projects/rarfs/files/ and extract it.

    Build and install the code. (see first post)

    No need to mess with users and permissions. Also for Ubuntu 10.04 this isn't necessary anymore.


    For easy access in Nautilus, see the post from hardik123, but place this in the two files:

    Code:
    #!/bin/sh
    DIR=/home/`whoami`/rarfs
    /sbin/mount.fuse rarfs#$1 $DIR
    Code:
    #!/bin/sh
    DIR=/home/`whoami`/rarfs
    /usr/bin/fusermount -u $DIR
    And the same changes for the original basic script:
    Code:
    #!/bin/sh
    DIR=/home/`whoami`/rar.mount/
    /sbin/mount.fuse rarfs#$1 $DIR
    gmplayer -fs -zoom $DIR`ls $DIR`
    /usr/bin/fusermount -u $DIR
    The advantage of this method over VLC is that you can use whatever player you want. e.g. SMPlayer. Also, this tread is older than VLC had support for playing rars. If you still have an older VLC version, you can get the plugin here: http://www.shapeshifter.se/code/vlc-unrar/

    You can also use this script and associate it as default program to open a rar file. If the rar file has a certain size, it will be opened with vlc. Otherwise the archival program will be used.

    Code:
    #!/bin/bash
    #get the size of the file
    SIZE=`stat -c %s "$@"`
    
    #if the file is a rar file from a scene rar
    if [[ "$SIZE" -eq 15000000 || "$SIZE" -eq 20000000 || "$SIZE" -eq 50000000 ||  "$SIZE" -eq 100000000 ]] 
    then
    	#play the rar file with vlc
    	vlc "$@"
    elif [ -f $1 ] #file exists and is a regular file
    then
    	#open the file with the preferred archival programm
    	file-roller "$@"
    fi
    I recently switched to openSUSE on my laptop because of a couple of bugs I couldn't fix that I didn't have in hardy. VLC 1.1.0 often indicates an avi is broken while I had no problems with older vlc versions + the plugin. Thus I use rarfs to solve it.

  9. #9
    Join Date
    Aug 2010
    Beans
    1

    Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    I keep getting errors when trying to compile

    when i try ./configure
    Code:
    config.status: error: cannot find input file: doc/Makefile.in
    when i try make
    Code:
    nexx@lemur:~/rarfs$ make
    cd . && /bin/bash ./config.status config.h
    config.status: creating config.h
    config.status: config.h is unchanged
    make  all-recursive
    make[1]: Entering directory `/home/nexx/rarfs'
    Making all in .
    make[2]: Entering directory `/home/nexx/rarfs'
    make[2]: Leaving directory `/home/nexx/rarfs'
    Making all in src
    make[2]: Entering directory `/home/nexx/rarfs/src'
    Makefile:297: .deps/archiveblock.Po: No such file or directory
    Makefile:298: .deps/fileblock.Po: No such file or directory
    Makefile:299: .deps/main.Po: No such file or directory
    Makefile:300: .deps/markerblock.Po: No such file or directory
    Makefile:301: .deps/rararchive.Po: No such file or directory
    Makefile:302: .deps/rarblock.Po: No such file or directory
    make[2]: *** No rule to make target `.deps/rarblock.Po'.  Stop.
    make[2]: Leaving directory `/home/nexx/rarfs/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/nexx/rarfs'
    make: *** [all] Error 2
    I'm running Ubuntu 10.04.1 LTS
    please help.
    Last edited by NexX.swe; August 29th, 2010 at 12:21 PM.

  10. #10
    Join Date
    Nov 2007
    Beans
    19
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Access files within rar without extracting (perfect for video streaming)

    Do the files exist on your hard drive?
    .deps/rararchive.Po ect.

    Download the archive and try again.
    If the files do exist, then the error message is not very helpful.

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
  •