Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bcl
Channel Surfer

Python biftool replacement

I've just pushed out the first pass at a biftool replacement. You can find it here at my homevideo repository

It handles running ffmpeg, building the bif file and cleaning up after itself.

It has only tested on Linux (I don't have ffmpeg on my OSX box yet), but it should work fine with OSX and possibly with Windows if you tweak the path to ffmpeg since I don't think Popen will do a path search on Windows.
0 Kudos
16 REPLIES 16
bbefilms
Visitor

Re: Python biftool replacement

Thanks for making this available - I've been tearing my hair out running PERL scripts for Biftool on windows - at last a MacOSX solution.
0 Kudos
bcl
Channel Surfer

Re: Python biftool replacement

No problem! Let me know if it works on OSX ok so I can 'certify' it 🙂
0 Kudos
TommyTheKid
Visitor

Thanks!

Hi BCL, thanks soo much. I am also trying out your homevideo thing, but it seems like it might be very early in the development stages, I can produce a BIF files and an assoicated "feed" entry, but I haven't figured out how to get that specific feed instead of the TED talks (which are still interesting). I was able to use the "simplevideoplayer" app to stream my chosen mp4 file beautifully from my osx laptop. "Web Sharing" is just apache, isn't that nice 😉

Tommy
0 Kudos
bcl
Channel Surfer

Re: Python biftool replacement

There is a new and improved version in the works. ETA is when its ready 🙂

The XML files are static, so you need to:

* run the bif tool (I'm not happy with the image aspect ratio so you may want to play with that)
* run the staticvideo script to generate the XML file of all the movies
* edit the categories.xml to point to your server


For the new version I've gone in a totally different direction. I have a TornadoWeb application that handles serving up the media files as well as providing a (very) crude interface for editing details about the videos.

It will have much better documentation on how to install it and use it than the version that is currently released.
0 Kudos
TommyTheKid
Visitor

Re: Python biftool replacement

I noticed it produced a blah-SD.bif file, even though the mp4 file was from an HD source. Of course I think it was maybe Half-Res to save space? I dunno, I honestly just got ffmpeg installed with ports and tried it out, but I haven't actually told the roku how to find the bif file yet because I am using the "simplevideoplayer" example still. I will look through it a little more to see what I can do. Honestly, the BIF part is really secondary to the other stuff 🙂 The biggest problem I see is that the BIF file takes quite a while to generate, so it would be mostly impossible to generate it dynamically. It would probably have to be a periodic "cron" job or something similar instead.

** Maybe we should start another thread for the "channel/webapp" part ?
(but in the mean time)

I was looking at a way to have the XML file dynamically generate when the roku requests it. Once we have the ability to I was thinking about basing the categories level on "folders" (directories). Either that or parsing based on the file name (between the dots) ... maybe a little of both. At this point, I only have *one* mp4 file, and the rest are in AVI containers, and I don't really care to transcode right now. It has also been literally forever since I wrote any "webapps" ... so I am a bit rusty (no more like rusted solid). I have also never tried python, but it doesn't look too difficult 🙂

~tommy
0 Kudos
bcl
Channel Surfer

Re: Python biftool replacement

I already have most of that working. The new system serves up the XML based on database entries. You rescan the source media directories to update the list. I currently don't have bif file generation integrated into it since it is such a long running process.
0 Kudos
TommyTheKid
Visitor

Re: Python biftool replacement

I saw the sqlite stuff creeping into the code. commit! I guess I am going to have to install mercurial now too 🙂

"bcl" wrote:
I already have most of that working. The new system serves up the XML based on database entries. You rescan the source media directories to update the list. I currently don't have bif file generation integrated into it since it is such a long running process.
0 Kudos
TommyTheKid
Visitor

Re: Python biftool replacement

Oh by the way, I sortof mentioned in in passing, but I "certify" that it runs on MAC OSX. I installed MAC PORTS and issued
sudo port install ffmpeg
and a little while later I had ffmpeg. I did need to modify the top line to read "/usr/bin/env" instead of just "/bin/env" ... but other than that, it runs fine. You are right though, its producing a squished image. My source is "widescreen" (but far from HD).

Tommy
0 Kudos
sully300
Visitor

Re: Python biftool replacement

bcl, I was able to get the biftool to unpack bifs created by your tool with the following fix. It's a simple off-by-one bug.

--- makebif.py.orig	2010-01-26 10:06:47.000000000 -0800
+++ makebif.py 2010-01-26 10:07:05.000000000 -0800
@@ -115,7 +115,7 @@
imageIndex += statinfo.st_size

f.write(struct.pack("<I1", 0xffffffff))
- f.write(struct.pack("<I1", imageIndex + 1))
+ f.write(struct.pack("<I1", imageIndex))

# Now copy the images
for image in images:
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.