Page 1 of 2

MxPEG Codec Support (open source C++ libs provided)

Posted: 04 Feb 2012 16:40
by gcams
I'm wondering if there is any potential for VLC to incorporate support for the open source MxPEG codec provied by mobotix:

http://developer.mobotix.com/#cpp_lib

There are open source C++ libraries made freely available by Mobotix at the above address, and adding this support would allow VLC to be used as a streaming/recording tool for all Mobotix cameras (and would include support to retreive audio from the camera, embedded in the MXPEG stream).

Currently there are very few video tools that support MxPEG and instead, us Mobotix owners need to fall back on MJPEG, which does not provide the same efficiencys, frame rates and critically has no audio support.

I for one would be hugely grateful if this codec could be incorporated in VLC and would be happy to test the functionality of such. I know there is a large community of Mobotix camera users who would also make use of VLC, if it contained MxPEG support!

I'm not a developer, but I'm hoping the fact that Mobotix have provided the decoding libraries/source code, it would make implementing the codec relatively easy?

Many thanks to the VLC development team for consideration of the above.

Cheers,
Graham

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 05 Feb 2012 12:20
by VLC_help
It would be better to integrate that to ffmpeg/avcodec.

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 05 Feb 2012 13:42
by gcams
Thanks for the reply vlc_help. Looks like some work was done back last year to incorporate MxPEG support into ffmpeg based on this:

http://ffmpeg.org/pipermail/ffmpeg-deve ... 05099.html

But I can't seem to track down if it ever made it into the finished product (and if it's currently supported). If the patch in the link above has been promoted to the current stable release, does this mean that VLC should "just work" decoding an MxPEG stream, if I give it the URL to the Mobotix MxPEG stream? Or does something else need to happen first (between ffmpeg/avcodec) to allow VLC to make use of the MxPEG decoder in FFMPEG?

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 05 Feb 2012 13:45
by gcams
Further to my post above, I just found this:

http://mailman.videolan.org/pipermail/v ... 83506.html

it looks like although ffmpeg does support MxPEG decoding, there is something missing in the works between VLC/ffmpeg to allow it to make use of the MxPEG decoding capabilities in ffmpeg.

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 06 Feb 2012 17:42
by Jean-Baptiste Kempf
There are some patches in the work.

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 06 Feb 2012 23:11
by gcams
There are some patches in the work.
Many thanks Jean-Baptiste, that is fantastic news!! :D

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 07 Feb 2012 10:45
by Sébastien Escudier
I think the ffmpeg demux can only handle raw mxpeg files.
It won't work in "live" (the http stream from the Mobotix camera).

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 07 Feb 2012 15:36
by HerrPi
This is a very interesting thread and I'd like to help you with the work to be done here.
Further to my post above, I just found this:
http://mailman.videolan.org/pipermail/v ... 83506.html
it looks like although ffmpeg does support MxPEG decoding, there is something missing in the works between VLC/ffmpeg to allow it to make use of the MxPEG decoding capabilities in ffmpeg.
It was I who asked this question. So yes, ffmpeg as well as the fork libav support MxPEG decoding by now. But you're right, there's still a missing link in the chain in order to work with VLC. This is also my goal!
There are some patches in the work.
This sounds fantastic indeed. So before I start digging deeper into the material of VLC, I'll just wait a bit. The subject seems to be quite current.
I think the ffmpeg demux can only handle raw mxpeg files.
It won't work in "live" (the http stream from the Mobotix camera).
This is not exactly true. Here are some of my results related to the topic. "A" means audio working, "V" means video working. This is also tested under Windows with the help of the appropriate cross-compiled command line versions of the tools.

LIBAV

play MxPEG livestream, A/V:

Code: Select all

avplay -f mxg "http://<ip>/control/faststream.jpg?stream=mxg" avplay -f mxg "http://<ip>/control/faststream.jpg?stream=MxPEG"
fetch livestream and transcode on the fly, A/V:

Code: Select all

avconv -f mxg -i "http://<ip>/control/faststream.jpg?stream=mxg" -f mpeg out.mpg
VLC: ("Media" -> "Open Network Stream" -> "Network URL")

this only gets a MJPEG stream, so only V:

Code: Select all

http://<ip>/control/faststream.jpg?stream=full
VLC is also able to directly transcode the above stream, e.g. into MPG, OGG, etc.

FFMPEG:

fetch MJPEG livestream and transcode on the fly, V:

Code: Select all

ffmpeg -f mjpeg -i "http://<ip>/control/faststream.jpg?stream=full" -f mpeg out.mpg
play MxPEG livestream, A/V:

Code: Select all

ffplay -f mxg "http://<ip>/control/faststream.jpg?stream=mxg" ffplay -f mxg "http://<ip>/control/faststream.jpg?stream=MxPEG"
And here's a command that fetches an MxPEG-Stream via LIBAV, transcodes it into MPEG and lets MPlayer play it, A/V:

Code: Select all

http_proxy= avconv -f mxg -i "http://admin:meinsm@10.9.53.86/control/faststream.jpg?stream=mxg" -f mpeg - | mplayer -
Last but not least, all of the named tools (except VLC of course, that's why we're talking here in the first place) are able to play back an already recorded MxPEG video clip. This was already said here in the thread. FFmpeg / libav integrated support for MxPEG video files some while ago (with the help of Anatoly Nenashev). I think MxPEG is recognized and activated by the file extension "MXG" / "mxg". So there is no problem playing an .mxg clip (A/V) by simple means without further command line arguments of ffplay / avplay. This is also possible under Windows.

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 07 Feb 2012 15:53
by Sébastien Escudier
HerrPi, thanks for the info, I'll have a look

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 16 Feb 2012 13:43
by Sébastien Escudier
Unfortunately, I don't think it's possible to add live (http) mxpeg support easily.
We cannot use the ffmpeg demuxer directly with http stream.

So I can add the mxg file support, but the live support would need more work : we would need to write our own mxpeg demuxer.

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 16 Feb 2012 14:12
by Jean-Baptiste Kempf
Why is it so? We do flv over http correctly, don't we?

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 21 Feb 2012 13:38
by Sébastien Escudier
done, for vlc 2.0.1
Note :
files are correctly detected but live input is not auto-detected by ffmpeg, so you must add this option in vlc :
ffmpeg-format=mxg

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 23 Feb 2012 12:28
by HerrPi
Thanks a lot for this work!

I'm not completely through, though. I just downloaded the latest nightly Windows build (http://nightlies.videolan.org/build/win ... 20223-0403) and tried to load an MXG clip file I had previously recorded (I used the GUI version). It didn't load. I also couldn't read any suspicious error or warning message. The only warning that was output was "direct3d warning: trying surface pixel format: YV12", but I don't think this is a critical one. The regular debug messages show "Buffering 0%" for quite some time.
Further, the windows stayed black.
It's about the same behaviour with live stream.

Am I doing something wrong? Can you send me a clip file that's working for you?

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 23 Feb 2012 13:07
by Sébastien Escudier
I tried the windows build and I have the same bug.

It works fine for me on linux, and I don't know why...

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 24 Feb 2012 15:40
by Sébastien Escudier
I found the bug, a patch is on the way.

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 28 Feb 2012 15:56
by Sébastien Escudier
done

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 04 Mar 2012 02:44
by alexschomb
Awesome, I've been waiting for this to happen for years! Thanks for the great work! Does that mean we can now watch live audio MXPEG streams on Mac and Linux systems? (no need for the ActiveX plugin and all?)
files are correctly detected but live input is not auto-detected by ffmpeg, so you must add this option in vlc :
ffmpeg-format=mxg
As a sidenote I think I found out what Sébastien meant concerning the "option in vlc", which was unclear to me at first. It works as supposed when I start the latest nightly build (Mac 64bit) from commandline appending the following (without quotes) "--ffmpeg-format=mxg". Here is an example:

Code: Select all

$ VLC.app/Contents/MacOS/VLC --ffmpeg-format=mxg "http://IP:PORT/control/faststream.jpg?stream=MxPEG"
Sadly though I'm having connection problems and therefor the sound is making no fun at all, but at least something comes through. I'm going to try this out from the LAN soon.

Edit: My connection seems to be better now and I can watch the live-stream fluently with full audio output. Awesome :)

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 05 Mar 2012 09:08
by Sébastien Escudier

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 07 Mar 2012 18:21
by gcams
This is absolutely awesome guys! A huge thank you to EVERYBODY who has contributed to this! I've just downloaded the latest nightly build and tested, and it's working beautifully. Thanks again all!!

PS: I'm going to post a link to the VideoLan MxPeg WIKI in the Mobotix forums, to make everybody there aware of all the hard work that has gone on here.

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 07 Mar 2012 18:24
by Jean-Baptiste Kempf
PS: I'm going to post a link to the VideoLan MxPeg WIKI in the Mobotix forums, to make everybody there aware of all the hard work that has gone on here.
Cool. 2.0.1 is on the way.

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 02 Oct 2012 12:36
by pbirkoff
Maybe it's me, but I've tried this and it doesn't work. When I open the stream, nothing happens in VLC Media Player. Any suggestions?

Edit: It finally worked, but aparently the stream only starts after a couple of minutes, showing the images of the start. So there seems to be a big delay. Also, there is no audio. Any suggestions?

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 27 Jan 2013 01:27
by mll
Re: Mxg file conversion

VLC has no problem reading/playing test .mxg file, but struggles with 'convert/save' fuction to create .mp4 or .mov files. Receive this error message: http://www.tejashummer.com/VLC_error.JPG. Must be a 'keystroke' problem on my part, as VLC seems to have no problem with reading/playing .mxg file. Thanks very much for any
suggestions on remedy. All the best. ... MLL

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 02 Feb 2013 15:49
by varna2
Hello,

I face ~10-20 seconds delay (lag) when comparing real-video with video-on-screen. This makes it not possible to use video for monitoring/security applications. Is this normal or do I have some configuation issues?

Windows 7 64bit, VLC 2.0.5, starting command:
vlc.exe --ffmpeg-format=mxg "http://1.2.3.4/control/faststream.jpg?stream=MxPEG"

Thank you

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 18 Jun 2013 20:28
by tekkfreakz
http://82.157.120.176/cgi-bin/faststream.jpg?stream not working vlc 2.01-2.02- 2.03-2.04-2.05-2.06-2.07
http://82.157.120.176/cgi-bin/faststream.jpg?stream vlc 1.1.11 yes working
vlc 2.07 how do I run ?

Re: MxPEG Codec Support (open source C++ libs provided)

Posted: 19 Jun 2013 14:44
by Ludrax

Code: Select all

ps warning: garbage at input, trying to resync...