Change default video bitrate

I posted some instructions on how to change the default video bitrate as a reply to a feature request. It later dawned upon me that this reply might actually be considered a mod so I'll just repost it here where it is more likely to be found. Given the popularity of that thread it seems I'm not the only one looking for this feature...
These instructions are based on a standard Debian Linux installation. If you use something else you might have to adjust some paths.
Setting the default video bitrate currently requires going in to the source, editing a single .java file, recompiling it and replacing it in the subsonic WAR archive. In short you'll want to get the source, edit net/sourceforge/subsonic/controller/VideoPlayerController.java and change the DEFAULT_BIT_RATE setting (I set it to 400). Once done you compile this single java file into a single .class file. To get the file to compile you need to feed javac a classpath which contains all it needs. In my case (where the source is located under /var/src):
Now replace the original VideoPlayerController.class file in /usr/share/subsonic/subsonic.war (WEB_INF/classes/net/sourceforge/subsonic/controller/VideoPlayerController.class with the newly compiled version:
Restart subsonic. You now have a default video bitrate of whatever you set DEFAULT_BIT_RATE to, in my case 400.
I attached the modified VideoPlayerController.class (default bit rate is set to 400). This class file comes from the most recent beta (4.7b3), if you don't feel like going through all the motions AND if you trust me to not have included all sorts of nastyness in this class file you can try to use it. You'll have to do the replacement of the class in the WAR yourself, though... The .class file is packed in a ZIP file to circumvent this forum's braindead attachment filter ('The extension class is not allowed'). Unpack the zip into the path mentioned above (WEB-INF/classes/net/sourceforge/subsonic/controller/) and follow the instructions on how to replace the class file within the WAR.
These instructions are based on a standard Debian Linux installation. If you use something else you might have to adjust some paths.
Setting the default video bitrate currently requires going in to the source, editing a single .java file, recompiling it and replacing it in the subsonic WAR archive. In short you'll want to get the source, edit net/sourceforge/subsonic/controller/VideoPlayerController.java and change the DEFAULT_BIT_RATE setting (I set it to 400). Once done you compile this single java file into a single .class file. To get the file to compile you need to feed javac a classpath which contains all it needs. In my case (where the source is located under /var/src):
- Code: Select all
javac -classpath /var/subsonic/jetty/3060/webapp/WEB-INF/lib/\*:/var/subsonic/jetty/3060/webapp/WEB-INF/classes:/usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar net/sourceforge/subsonic/controller/VideoPlayerController.java
Now replace the original VideoPlayerController.class file in /usr/share/subsonic/subsonic.war (WEB_INF/classes/net/sourceforge/subsonic/controller/VideoPlayerController.class with the newly compiled version:
- Code: Select all
mkdir -p WEB-INF/classes/net/sourceforge/subsonic/controller/
cp net/sourceforge/subsonic/controller/VideoPlayerController.class WEB-INF/classes/net/sourceforge/subsonic/controller/
jar uf /usr/share/subsonic/subsonic.war WEB-INF/classes/net/sourceforge/subsonic/controller/VideoPlayerController.class
Restart subsonic. You now have a default video bitrate of whatever you set DEFAULT_BIT_RATE to, in my case 400.
I attached the modified VideoPlayerController.class (default bit rate is set to 400). This class file comes from the most recent beta (4.7b3), if you don't feel like going through all the motions AND if you trust me to not have included all sorts of nastyness in this class file you can try to use it. You'll have to do the replacement of the class in the WAR yourself, though... The .class file is packed in a ZIP file to circumvent this forum's braindead attachment filter ('The extension class is not allowed'). Unpack the zip into the path mentioned above (WEB-INF/classes/net/sourceforge/subsonic/controller/) and follow the instructions on how to replace the class file within the WAR.