1.26.4 Error while decoding frame errors

Forum for questions and support relating to the 1.26.x releases only.
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

1.26.4 Error while decoding frame errors

Post by chippy99 »

I just upgraded my 1.26.3 system to 1.26.4 and get lots of decoding frame errors in the system log and very slow frame rates/ corrupted images when viewing. Tried upgrading ffmpeg to latest version (version N-57145-g42a8d8a) and recompiled but still getting same errors. Cameras are using rstp and mjpeg.
Reverted back to 1.26.3 and everything working fine again. Anybody got any ideas ?

Image
sgn
Posts: 68
Joined: Mon Oct 25, 2004 2:36 pm

Re: 1.26.4 Error while decoding frame errors

Post by sgn »

You'll get these if your ffmpeg-libs aren't up to the task. Maybe you compiled 1.26.4 with the wrong ffmpeg path or omitted some options?
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: 1.26.4 Error while decoding frame errors

Post by chippy99 »

Just did a fresh install of ffmpeg and Zoneminder and still getting same errors. Have reverted back to 1.26.3 and all working ok again. Used same configure options to build 1.26.4 and 1.26.3 so the configure options cannot be the problem. Very odd.
pezed
Posts: 7
Joined: Tue Aug 23, 2011 4:21 am

Re: 1.26.4 Error while decoding frame errors

Post by pezed »

I'm seeing the same problem with 1.26.4 using the iconner ppa on ubuntu server. Downgrade back to 1.26.3 and the issue is gone. I also use rtsp mpeg streaming cameras.
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: 1.26.4 Error while decoding frame errors

Post by chippy99 »

Is anyone using 1.26.4 with rtsp mpeg without getting any errors ?
pok
Posts: 9
Joined: Tue Feb 14, 2012 1:29 pm

Re: 1.26.4 Error while decoding frame errors

Post by pok »

I tested the patch with FFmpeg 10.2/10.4 ... The error occurs after the call after avcodec_decode_video2, may be in the current version of FFmpeg something has changed ... I can not verify this for the next week: (you'll have to wait

Usually a frame decoding error occurs if the ffmpeg is built without swscale.
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: 1.26.4 Error while decoding frame errors

Post by chippy99 »

This is the output from ffmpeg, it shows swscale is present.

Code: Select all

ffmpeg version N-57215-g3ed65d9 Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct 17 2013 01:09:29 with gcc 4.8.1 (GCC) 20130725 (prerelease)
  configuration: --prefix=/usr/local --enable-gpl --enable-postproc --enable-swscale --enable-pthreads --enable-x11grab --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libxvid --enable-nonfree --enable-version3 --enable-libvpx --enable-nonfree --enable-libspeex --enable-libv4l2 --enable-libxvid --enable-libspeex --enable-libpulse --enable-libx264 --arch=x86_64 --enable-runtime-cpudetect
  libavutil      52. 46.101 / 52. 46.101
  libavcodec     55. 37.100 / 55. 37.100
  libavformat    55. 19.102 / 55. 19.102
  libavdevice    55.  4.100 / 55.  4.100
  libavfilter     3. 88.101 /  3. 88.101
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: 1.26.4 Error while decoding frame errors

Post by chippy99 »

A temporary solution to this is to copy the 1.26.3 version of zm_rtp_source.cpp from the src directory into the 1.26.4 release and recompile with that. Seems to work ok and fixes the decoding frame errors.
Hopefully somebody cleverer than me will be able to resolve this problem soon.
abalamut
Posts: 6
Joined: Mon Oct 28, 2013 2:15 pm

Re: 1.26.4 Error while decoding frame errors

Post by abalamut »

Hello, last days I try Zoneminder 1.26.4, Ubuntu Server 12.04 and Dlink DCS-6113 cam.
Installed by this guide
http://www.zoneminder.com/wiki/index.ph ... e_easy_way
I can connect my cam using rtsp. Http does not work - don't know why.
If I connect cam using rtsp I can see a lot of error - like this. But picture looks good.
Screen Shot 2013-10-28 at 18.12.56.png
Screen Shot 2013-10-28 at 18.12.56.png (226.56 KiB) Viewed 10605 times
If I connect cam using ffmpeg, and provide path to cam rtsp://IP_ADDRESS:554/live2.sdp
I have not any errors - but image quality not good.

Also I try older version of ZM - it does not work at all with my cam.
chippy99 - sas: temporary solution to this is to copy the 1.26.3 version of zm_rtp_source.cpp from the src directory into the 1.26.4 release and recompile with that.
But I can not find old version of Zoneminder. Also unfortunetelly, I have not enough skill to couple ZM from sources.
pok
Posts: 9
Joined: Tue Feb 14, 2012 1:29 pm

Re: 1.26.4 Error while decoding frame errors

Post by pok »

chippy99 wrote:A temporary solution to this is to copy the 1.26.3 version of zm_rtp_source.cpp from the src directory into the 1.26.4 ...
zm_rtp_source.cpp file versions 1.26.3 and 1.26.4 differ only in the type casting ... so strange a decision ...

see diff below

--- ZoneMinder-1.26.3/src/zm_remote_camera_rtsp.cpp
+++ ZoneMinder-1.26.4/src/zm_remote_camera_rtsp.cpp
@@ -161,7 +161,7 @@
// Find first video stream present
mVideoStreamId = -1;

- for ( int i = 0; i < mFormatContext->nb_streams; i++ )
+ for ( unsigned int i = 0; i < mFormatContext->nb_streams; i++ )
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
if ( mFormatContext->streams->codec->codec_type == AVMEDIA_TYPE_VIDEO )
#else
@@ -183,7 +183,11 @@
Panic( "Unable to locate codec %d decoder", mCodecContext->codec_id );

// Open codec
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 7, 0)
if ( avcodec_open( mCodecContext, mCodec ) < 0 )
+#else
+ if ( avcodec_open2( mCodecContext, mCodec, 0 ) < 0 )
+#endif
Panic( "Can't open codec" );

// Allocate space for the native video frame
@@ -196,10 +200,10 @@
Fatal( "Unable to allocate frame(s)");

int pSize = avpicture_get_size( imagePixFormat, width, height );
- if( pSize != imagesize) {
+ if( (unsigned int)pSize != imagesize) {
Fatal("Image size mismatch. Required: %d Available: %d",pSize,imagesize);
}
-
+/*
#if HAVE_LIBSWSCALE
if(!sws_isSupportedInput(mCodecContext->pix_fmt)) {
Fatal("swscale does not support the codec format: %c%c%c%c",(mCodecContext->pix_fmt)&0xff,((mCodecContext->pix_fmt>>8)&0xff),((mCodecContext->pix_fmt>>16)&0xff),((mCodecContext->pix_fmt>>24)&0xff));
@@ -212,7 +216,7 @@
#else // HAVE_LIBSWSCALE
Fatal( "You must compile ffmpeg with the --enable-swscale option to use RTSP cameras" );
#endif // HAVE_LIBSWSCALE
-
+*/

return( 0 );
}
codabiz
Posts: 59
Joined: Sun Jan 04, 2009 10:16 am
Location: London, UK

Re: 1.26.4 Error while decoding frame errors

Post by codabiz »

I am interested in your error problem. I wonder whether it is related to my forum topic about 'make' fails. I wrote about: avcodec_decode_video2 being only in libavcodec 54 and above.

For example, the latest Ubuntu Server 12.04.03 version has libavcodec version 53

However, avcodec.decode_video is deprecated since libavcodec54. Yet your latest ffmpeg is compiled with avcodec_decode_video2 ( in libavcodec55).

So is there an ffmpeg mismatch, or a conflict of versions going on? Just a novice thought!
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: 1.26.4 Error while decoding frame errors

Post by chippy99 »

zm_rtp_source.cpp are very different between 1.26.3 and 1.26.4.
You have diffed zm_remote_camera_rtsp.cpp not zm_rtp_source.cpp
It looks like the latest version will only work with H.264 since it is looking for NAL packets only.
User avatar
dvarapala
Posts: 54
Joined: Sat Nov 06, 2010 2:30 pm

Re: 1.26.4 Error while decoding frame errors

Post by dvarapala »

chippy99 wrote:It looks like the latest version will only work with H.264 since it is looking for NAL packets only.
Not only that, but it will only work for one type of fragmentation (FU-A) and will fail if FU-B is used.
abalamut
Posts: 6
Joined: Mon Oct 28, 2013 2:15 pm

Re: 1.26.4 Error while decoding frame errors

Post by abalamut »

Hello Guys ))
Thanks you for replays, but can some one provide some fix?
As I told it before, I can not compile ZM from source (I have not enough skill)
Is it possible release some dpkg or maybe some patch and detailed instruction how I can apply it?
Thanks you!
pok
Posts: 9
Joined: Tue Feb 14, 2012 1:29 pm

Re: 1.26.4 Error while decoding frame errors

Post by pok »

chippy99 wrote:zm_rtp_source.cpp are very different between 1.26.3 and 1.26.4.
You have diffed zm_remote_camera_rtsp.cpp not zm_rtp_source.cpp
It looks like the latest version will only work with H.264 since it is looking for NAL packets only.
Yes, you are certainly right ...
However, the error occurs at the moment of trying to frame decoding in the file zm_rtp_source.cpp.

"Very different" - it's only the support of a fragmented NAL package

Yes, the part relating to RTP, corrected for working with the flow of H264. Moreover, it is possible that implementation only for the hikvision cameras.

The problem may be that it is your camera offers a choice of several implementations of the flow ... in version 1.26.3 when trying to take a fragmented NAL was an error and was used mjpeg.

there some pictures... and some errors...
Locked