mpeg streaming

Support and queries relating to all previous versions of ZoneMinder
Locked
Laevi
Posts: 42
Joined: Mon Aug 27, 2007 1:50 pm

mpeg streaming

Post by Laevi »

Hello again

i'm trying to get a stream without using cambozola because it's not too fast, but i can't get it to work.
I have ffmpeg installed and generating any video files works perfectly i only have problems when it comes to streaming.
I can't see anything noticable in the logs and i rebuilded ZM --with-ffmpeg=... but still no luck.

Anyone can clearify if this is a configuration problem or a browser/plugin problem?

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

Post by jameswilson »

getting ffmpeg and zm to function fully together needs zm to be compliled against the right version of ffmpeg. If you have installed from source then it should be ok, if you have used a package manager then if the version that zm was built to use if different from the one you installed you will have problems
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
sergiut2002
Posts: 30
Joined: Wed Sep 19, 2007 11:54 am
Location: Constanta Romania

Post by sergiut2002 »

can you post how did u copiled zm with ffmpeg support? i tried to compile on ubuntu without success

thanks
________
Honda VT250F history
Last edited by sergiut2002 on Sun Feb 13, 2011 3:51 pm, edited 1 time in total.
Laevi
Posts: 42
Joined: Mon Aug 27, 2007 1:50 pm

Post by Laevi »

Thx for your reply james..
I tried to rebuild ZM again with ffmpeg but now i noticed i was missing the libavutil where the libavcodec and libavformat are normally installed.

Anybody knows if this library can be installed seperately or has a ffmpeg version where this one is included also?

Thx.

- Edit: Found it and installed it and reinstalled ZM with ffmpeg but still get the same error in log:

Code: Select all

Oct 25 14:40:45 localhost zms[10052]: ERR [MPEG streaming of 'mode=mpeg&monitor=1&scale=100&bitrate=25000&maxfps=5&format=asf&user=admin&rand=1193316040' attempted while disabled]
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

thge 'attempted while disabled' is something i would look at. Like i said i have never been successful mysle fin getting zm to work with ffmpeg on anything than the live cd.... so i dont bother anymore lol
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
Laevi
Posts: 42
Joined: Mon Aug 27, 2007 1:50 pm

Post by Laevi »

So can anybody (developer from the live cd or something) tell me how they configured ZM and ffmpeg to work together on the mpeg streaming?
Would be appreciated greatly :roll:

I found where the error is generated (zms process):

Code: Select all

#if HAVE_LIBAVCODEC
				 monitor->StreamMpeg( format, scale, maxfps, bitrate );
#else // HAVE_LIBAVCODEC
				Error(( "MPEG streaming of '%s' attempted while disabled", query ));
				fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" );
				return( -1 );
#endif // HAVE_LIBAVCODEC
So if i'm right ZM doesn't recognizes 'libavcodec'?

Though:

Code: Select all

FC-NVR:/# ffmpeg -version
ffmpeg version 0.4.9-pre1, build 4718, Copyright (c) 2000-2004 Fabrice Bellard
  built on Oct 25 2007 16:16:49, gcc: 3.3.5 (Debian 1:3.3.5-13)
ffmpeg      0.4.9-pre1
ibavcodec  4718
libavformat 4616
libavcodec is obviously installed. Any thoughts?
Laevi
Posts: 42
Joined: Mon Aug 27, 2007 1:50 pm

Post by Laevi »

I found out there was an error in the ZM zms.cpp that gets executed when calling './configure'. After a bit of tweaking and editing the files of both ZM and ffmpeg i got it to work.

So this can be closed :lol:
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

its over my head but what was the error, ie did you find a bug?
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
Laevi
Posts: 42
Joined: Mon Aug 27, 2007 1:50 pm

Post by Laevi »

when executing the ./configure (with the --with-ffmpeg statement and the right directory pointed)it succesfully found the binaries (libavcodec and libavformat) but when using mpeg streaming afterwards it gave an error in the logs:

Code: Select all

MPEG streaming of 'Cam1' attempted while disabled. MPEG streaming is disabled. You should configure with the --with-ffmpeg option and rebuild to use this functionality.
I looked up the error i got which was found in the zms part of the configure (in the src map - zms.cpp):

Code: Select all

#if HAVE_LIBAVCODEC
             monitor->StreamMpeg( format, scale, maxfps, bitrate );
#else // HAVE_LIBAVCODEC
            Error(( "MPEG streaming of '%s' attempted while disabled", query ));
            fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" );
            return( -1 );
#endif // HAVE_LIBAVCODEC
although the variable 'HAVE_LIBAVCODEC' was stated as '1' in the config.h file it still gave the error.
So i rewrote the if-statement to always execute the part which would normally be executed if the HAVE_LIBAVCODEC was 1:

Code: Select all

monitor->StreamMpeg( format, scale, maxfps, bitrate );
Then i got another error in the make process but that was not really related to this one i think, there was an empty '#include' statement in the one of the other building files.
After deleting this sentence all configured and maked well, and the streaming works great.

Hope this is of some use but i'm not sure it's a bug or something that went wrong on my side.
liviab
Posts: 87
Joined: Wed Oct 15, 2008 11:54 am
Location: Brazil [MG]

Post by liviab »

Hii Laevi,

so, what did you do?? You executed the ./configure with --with-ffmpeg and change the zms.ccp file??
Here it isn't working mpeg well. The ZM captures motion, saves images and videos, although nothing is shown in the browser.

Please, help me!! :)
Locked