Ogg Theora streaming

Support and queries relating to all previous versions of ZoneMinder
Locked
SyRenity
Posts: 301
Joined: Mon Jan 24, 2005 2:43 pm

Ogg Theora streaming

Post by SyRenity »

Hi Phil.

In this thread, you mentioned that it's possible to stream the video in the Ogg Theora codec, rather then in MPEG4: http://www.zoneminder.com/forums/viewto ... ght=theora

This came as a possible resolution to the delay present in the Windows Media Player. I checked around, and there is a good variety of Java/Activex Theora browser player plugins available.
It can be a good replace for the WMP, similar to the MediaFrame, but using another codec, which should give a better bandwidth/quality ratio, and resolve the lag issue.

Could you please list the instructions needed to set ZM to work with Theora?

Thanks.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

I have been looking ito ffmpeg a bit lately and im not sure they have finished this streaming type so it might need a bit of coaxing. I would assume that you change the asf extension in setting to whatever the ogg one is.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I've not actually got live streaming working, as I don't have a player that seems to be easy to use. I did get some videos produced in ogg format though. You have to compile ffmpeg with additional options though as I recall.

Phil
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

You do have to compile ffmpeg with extra options to support ogg. FYI the packages I have for both distros have it compiled in. I also reduced the dependancies for the x86_64 package by not compiling in some of the decoders since the conversion for now is only from jpeg. I also made sure that any packages that are normaly in a FC install (ogg, vorbis, etc.) were compiled in. :D
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Judging from the excitement on the swf thread it seems that perhaps the easiest solution to live streaming is via flash anyway now. It look easier to set up than ogg anyway.

Phil
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Oh, I agree and will be watching that thread closely till I have an opertunity to get in and play. But is it not useing ffmpeg to encode mpeg4?
I have just one issue stopping the x86_64 distro right now were Grub is not loading correctly once I get beyond that and finnish up the new code for zminit the release will follow and I can move on and play a bit.
SyRenity
Posts: 301
Joined: Mon Jan 24, 2005 2:43 pm

Post by SyRenity »

Hi.

The Flash method is great, and allows new possibilities for the ZM, but it's still has it's problems, the main one is the large memory footprint. Also, the quality due to Flash Spark (H.263) compression is somewhat lower and quite blocky (which is especially visible on movements). This may change when the FFMPEG team implements Flash8 On2 VP6 codec, but until then...:).

Therefore, I still like to review other options, thus the Theora codec looks as a very promising alternative to WMP.

I will try Cordel's RMP's, and my main question is which format that should be set in the ZM options? OGG?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I would guess so, I can't actually remember. If ogg works on the command line with ffmpeg then that is what you will need to pass into ZM. In fact it's probably easier to do you experimenting directly with ffmpeg first and then just transfer the parameters.

Phil
SyRenity
Posts: 301
Joined: Mon Jan 24, 2005 2:43 pm

Post by SyRenity »

Hi.

I tried to compile the Theora support in the current version of ZM (1.21.4). FFMPEG compilation stage went fine, but unfortunately, I can't compile ZM, as it can't find the libtheora-devel library. (All the functions, like theora_init() can not be located).

The question is, if there any way to compile current ZM with Theora? Or only the latest 1.22 supports it via "extra libs"?
SyRenity
Posts: 301
Joined: Mon Jan 24, 2005 2:43 pm

Post by SyRenity »

Hi.

Phil, this one goes to you for sure :).

I managed to compile the zms via external IDE. Unfotunately, when setting OGG as the output format, it segfaults. When stepping with a debugger, I noticed that guess_format() (located in zm_mpeg.cpp), fills the "of" structure with Vorbis audio settings only. Meaning, the of->mime_type has "audio/x-vorbis" set, and the of->video_codec equals to CODEC_ID_NONE.

Apparently, FFMPEG can't correctly guess that Theora video codec is used from the "ogg" extension? Or perhaps a diffrent extension should specify after all.

BTW, the command line FFMPEG is not working with Theora as well. It returns me the following message: "No audio or video streams available".

The only software that allowed me to encode into ogg, was ffmpeg2theora (www.v2v.cc/~j/ffmpeg2theora/). I checked the source code, and it seems it doesn't use the guess_format() function at all.

Perhaps the Theora support in CVS version of FFMPEG is broken?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think you have to build ffmpeg with additional options to use Theora. In 1.22.0 you will need to supply any additional libraries to configure when you build ZM, in earlier versions unfortauntely you will need to add them to the Makefile manually. I've not done a lot with ogg files other than seeing if I could generate them, which I could. However I couldn't find a player to view them on at the time :cry:

1.22.0 allso makes it a lot easier to manage mime types by the way.
Phil
SyRenity
Posts: 301
Joined: Mon Jan 24, 2005 2:43 pm

Post by SyRenity »

Hi.

Do you remember, perhaps, which options to include with Theora? The FFMPEG building requires the OGG format (--with-libogg) to be specified if Theora is used, but other then that, there is nothing more required.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Unfortunately not. Also my dev box went up in smoke at the weekend so I can't even check what I had installed on it. Sorry :cry:
Phil
SyRenity
Posts: 301
Joined: Mon Jan 24, 2005 2:43 pm

Post by SyRenity »

Hi.

Thanks anyway - I will try to find the right setup, and will post my results here.
Locked