2004-03-24, 06:05
almost everything i watch with xbmc comes packaged in multiple .rar volumes. it's always a pain having to unrar stuff before being able to watch it (can take a few minutes, may not have enough temporary space available, may want to keep original .rar files for archive purposes etc), so i made some small changes in xbmc and in the ccxstream stream server for linux which make it possible to watch divx / vcd / svcd / dvd video straight from .rar files without unraring.
what you need:
xbmc compiled from current sources (util.cpp / util.h / mplayer.cpp / mplayer.h updates committed 03-24).
you need to add ".rar" to the list of <videoextensions> in your xboxmediacenter.xml.
a linux box as your stream server, on which you need:
/usr/bin/rar (using version 3.30 here)
ccxstream (http://prdownloads.sourceforge.net/xbmc/....15.tar.gz) with the following patch applied:
(download patch or full ccxstream.c, then run "make" and start ccxstream)
how it works: when xbmc requests a .rar file from the patched ccxstream, instead of sending the .rar as-is, ccx launches rar and sends the unrared data directly to xbmc without it being saved on the pc.
the only change necessary in xbmc was to tell mplayer to not try loading the index from the end of .avi files if we are attempting to load from a .rar (the end of the file is not available when we've just started unraring). this also means that seeking is totally disabled while playing .avis from rars (you can still pause or stop). for mpeg videos, you can seek a little bit forward as far as your lan streaming buffer permits.
note to windows users: don't ask me how to set something like this up under windows. maybe someone else will patch a windows stream server in the same way.
i would welcome any feedback in case someone else finds this useful and has it working on their system.
---
addendum (2003-05-02): pre-patched versions of ccxstream and xbms (a linux/freebsd xns protocol stream server) with unrar support are now available to download here: http://sourceforge.net/project....d=97904
what you need:
xbmc compiled from current sources (util.cpp / util.h / mplayer.cpp / mplayer.h updates committed 03-24).
you need to add ".rar" to the list of <videoextensions> in your xboxmediacenter.xml.
a linux box as your stream server, on which you need:
/usr/bin/rar (using version 3.30 here)
ccxstream (http://prdownloads.sourceforge.net/xbmc/....15.tar.gz) with the following patch applied:
Quote:*** ccxstream.c mon mar 17 14:29:15 2003
--- ccxstream.c wed mar 24 04:48:48 2004
***************
*** 973,977 ****
return 1;
}
! conn->f[fh] = fopen(hlp, "r");
cc_xfree(hlp);
cc_xfree(s);
--- 973,989 ----
return 1;
}
! if (strcasecmp(&hlp[strlen(hlp)-4], ".rar") == 0) /* omg c sucks for string operations */
! {
! char *unrar_exec_str;
! unrar_exec_str = cc_xmalloc(strlen(hlp)+60);
! sprintf(unrar_exec_str, "/usr/bin/rar p -inul \"%s\" \"*.mpg\" \"*.avi\" \"*.img\" \"*.bin\"", hlp);
! conn->f[fh] = popen(unrar_exec_str, "r");
! }
! else
! {
! /* if filename doesnt contain .rar it must be a normal file so open it directly */
! conn->f[fh] = fopen(hlp, "r");
! }
!
cc_xfree(hlp);
cc_xfree(s);
(download patch or full ccxstream.c, then run "make" and start ccxstream)
how it works: when xbmc requests a .rar file from the patched ccxstream, instead of sending the .rar as-is, ccx launches rar and sends the unrared data directly to xbmc without it being saved on the pc.
the only change necessary in xbmc was to tell mplayer to not try loading the index from the end of .avi files if we are attempting to load from a .rar (the end of the file is not available when we've just started unraring). this also means that seeking is totally disabled while playing .avis from rars (you can still pause or stop). for mpeg videos, you can seek a little bit forward as far as your lan streaming buffer permits.
note to windows users: don't ask me how to set something like this up under windows. maybe someone else will patch a windows stream server in the same way.
i would welcome any feedback in case someone else finds this useful and has it working on their system.
---
addendum (2003-05-02): pre-patched versions of ccxstream and xbms (a linux/freebsd xns protocol stream server) with unrar support are now available to download here: http://sourceforge.net/project....d=97904