Read RAR files

Got an idea? Missing something? Post your feature request here.

Moderator: moderators

Read RAR files

Postby ootuoyetahi » Wed Jan 04, 2012 9:12 pm

This is supported be a few media players. XBMC, VLC come to mind. I have a huge media server and it would nice to be able to not have to extract the movies to watch them.
ootuoyetahi
 
Posts: 53
Joined: Wed Mar 24, 2010 7:10 pm

Re: Read RAR files

Postby gardar » Mon Mar 26, 2012 7:40 am

This feature is definitely a must

+1
gardar
 
Posts: 16
Joined: Mon Mar 26, 2012 7:22 am

Re: Read RAR files

Postby gardar » Mon Mar 26, 2012 7:08 pm

Oh and just to add, XBMC and others actually do not support playing content from compressed rars but just stuff that has been packed with the "store" method. So the rars are not uncompressed, they are just mounted on the fly and then they can be plaid.

I know there do exist some libraries to mount rar files so it shouldn't be too hard to implement this feature.
gardar
 
Posts: 16
Joined: Mon Mar 26, 2012 7:22 am

Re: Read RAR files

Postby Zmegolaz » Tue Jul 03, 2012 2:29 am

Actually, this isn't hard to do, at least if you're running Linux. You can probably do something similar on Windows too, but I don't know how.

Install unrar
Install ffmpeg
Make symbolic links to these in the Subsonic transcode folder.
Log in to the Subsonic interface as an admin.
Add a new transcoding in Settings -> Transcoding -> Add transcoding.
Convert from: rar
Convert to: flv
Step one:
Code: Select all
unrar p -inul %s

Step two:
Code: Select all
ffmpeg -ss %o -i pipe:0 -async 1 -b %bk -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset superfast -threads 0 -

Go to Settings -> General and add " rar" to Video files to make it recognize the .rar files.

You might want to add " -s %wx%h" in step two (before the last dash (-)) if you're using a mobile device, to lower the resolution. The problem with this is that it seems to screw up the aspect ratio, but that's another thread's problem.

This extracts the rar archive, outputs the content to stdout, pipes it to ffmpeg which transcodes it and output the finished video to the player.
It will probably work with compressed archives too, I haven't tried.
However, you can not skip in the video. You have to start at the beginning each time.
You can use Subsonic's drop down menu to skip, but this takes some time, and I suspect it transcodes everything from the beginning up to that point. Heavy load on the server.

Happy videoing!

Edit:
It seems you can skip in the video, if you don't skip too far.
As soon as you start playing, the server starts transcoding, and don't stop until everything is done. As long as you don't jump further than the transcoding has gotten, it works.
I also added " -s 640x360" to my step two, to lower the resolution and set the aspect ratio to 16:9, which most my videos are.
Last edited by Zmegolaz on Tue Jul 03, 2012 12:37 pm, edited 3 times in total.
Zmegolaz
 
Posts: 7
Joined: Tue Dec 27, 2011 9:13 am

Re: Read RAR files

Postby diffy » Tue Jul 03, 2012 9:59 am

Excellent wizardry here

Thanks Zmegolaz :D
diffy
 
Posts: 97
Joined: Fri Dec 30, 2011 11:28 pm
Location: Copenhagen, Denmark

Re: Read RAR files

Postby enedene » Tue Aug 14, 2012 8:20 pm

+1
this would be a killer feature!
enedene
 
Posts: 6
Joined: Wed Jan 25, 2012 1:01 am

Re: Read RAR files

Postby DjJk » Thu Sep 06, 2012 3:04 pm

I've tested Zmegolaz's guide in Windows and got it working.

Just go to http://www.rarlab.com/rar_add.htm and download "UnRAR for Windows". Extract the downloaded file to your install-path/transcode, mine is "C:\subsonic\transcode", so that unrar.exe is added to your transcode-folder.
After that you just follow Zmegolaz's guide.

Works perfectly, it just takes a lot of performance while transcoding a 1080p movie.
DjJk
 
Posts: 2
Joined: Mon Jul 13, 2009 2:53 pm

Re: Read RAR files

Postby omegatotal » Sat Oct 25, 2014 10:49 am

If you are having any trouble with this on windows and can not figure it out, rename unrar.exe to un-rar.exe

That was all it took for me, Also, on the up dated versions of ffmpeg (at least on windows) you can not use pipe:# for the input, you just have to use -

Code: Select all
ffmpeg -ss %o -i - -async 1



you should see something like this in the subsonic web log

Code: Select all
[10/25/14 6:42:56 AM EDT]   INFO   PlayQueueInputStream   user listening to "something_here.rar"
[10/25/14 6:42:56 AM EDT]   DEBUG   TranscodeInputStream   Starting transcoder: [c:\_Subsonic\transcode\un-rar] [p] [-inul] [\\pathto\folderwith\something_here.rar]
[10/25/14 6:42:56 AM EDT]   DEBUG   TranscodeInputStream   Starting transcoder: [c:\_Subsonic\transcode\ffmpeg] [-i] [-] [-async] [1] [-b:v] [1000k] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [flv] [-vcodec] [h264] [-preset] [superfast] [-threads] [0] [-]
[10/25/14 6:44:22 AM EDT]   INFO   PlayQueueInputStream   user listening to "something_here.rar"
omegatotal
 
Posts: 10
Joined: Thu May 31, 2012 9:22 am


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 12 guests