Ask Your Question
1

OPENCV2.4.9 with IP cam have h246 error

asked 2014-08-10 10:50:55 -0600

qmail03 gravatar image

CODE:---------------------------------------------------------------

int main(){

CvCapture *camera=cvCreateFileCapture("rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif");
if (camera==NULL)
    printf("camera is null\n");
else
    printf("camera is not null");

cvNamedWindow("img");
while (cvWaitKey(10)!=atoi("q")){
   // double t1=(double)cvGetTickCount();
    IplImage *img=cvQueryFrame(camera);
   // double t2=(double)cvGetTickCount();
   // printf("time: %gms  fps: %.2g\n",(t2-t1)/(cvGetTickFrequency()*1000.), 1000./((t2-t1)/(cvGetTickFrequency()*1000.)));
    cvShowImage("img",img);
}
cvReleaseCapture(&camera);
cvDestroyWindow("img");

}

error :-------------------------------------------------------------

camera is not null[h264 @ 01c62240] Invalid level prefix [h264 @ 01c62240] error while decoding MB 49 23 [h264 @ 01c62240] Invalid level prefix [h264 @ 01c62240] error while decoding MB 34 33 [h264 @ 01c62240] Invalid level prefix [h264 @ 01c62240] error while decoding MB 14 33 [h264 @ 01c62240] out of range intra chroma pred mode at 17 35 [h264 @ 01c62240] error while decoding MB 17 35 [h264 @ 01dc5020] Invalid level prefix [h264 @ 01dc5020] error while decoding MB 54 34 image description

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
1

answered 2015-01-24 10:40:16 -0600

atlab gravatar image

updated 2015-01-25 08:38:31 -0600

Hi. I have the same problem. There are no difference in ffmpeg versions in OpenCV pack (... 2.4.8-3.0), it is 0.8.0 (look at \opencv\sources\3rdparty\readme.txt).

2015 Jan 25, more info.

I have built 3 variants of the opencv_ffmpeg.dll: ffmpeg-0.9.4, ffmpeg-1.2.11, ffmpeg-2.2.12. There are no differences with an IPcamera. Video files coded with h264 is playing without any problems.

edit flag offensive delete link more
0

answered 2015-07-13 09:57:43 -0600

joecmama gravatar image

I struggled with video feed being corrupted on my ip camera, and think I have solved some of the problems using libVLC with OpenCV. I use MS Visual Studio on Windows 7 and 8.1. Details are given here: http://answers.opencv.org/question/65932

edit flag offensive delete link more
0

answered 2015-01-05 05:30:07 -0600

harry gravatar image

I have the same problem using OpenCV 3.0.0 ( build from GIT ) and

--   Media I/O: 

--     ZLib:                        /usr/lib64/libz.so (ver 1.2.8)
--     JPEG:                        /usr/lib64/libjpeg.so (ver )
--     WEBP:                        build (ver 0.3.1)
--     PNG:                         /usr/lib64/libpng.so (ver 1.6.13)
--     TIFF:                        build (ver 42 - 4.0.2)
--     JPEG 2000:                   /usr/lib64/libjasper.so (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--     GDAL:                        NO
-- 
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  YES (ver 2.2.2)
--     FFMPEG:                      YES
--       codec:                     YES (ver 55.69.100)
--       format:                    YES (ver 55.48.100)
--       util:                      YES (ver 52.92.100)
--       swscale:                   YES (ver 2.6.100)
--       gentoo-style:              YES
--     GStreamer:                   
--       base:                      YES (ver 1.4.3)
--       video:                     YES (ver 1.4.3)
--       app:                       YES (ver 1.4.3)
--       riff:                      YES (ver 1.4.3)
--       pbutils:                   YES (ver 1.4.3)

By trying to show the stream with ffplay I have no troubles:

ffplay rtsp://10.0.1.107:554/ipcam_h264.sdp
ffplay version 2.3.5 Copyright (c) 2003-2014 the FFmpeg developers
  built on Jan  2 2015 09:03:59 with gcc 4.8 (SUSE Linux)
  configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --enable-libx265 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc --enable-gnutls
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.100 / 55. 48.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.100 /  4. 11.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, rtsp, from 'rtsp://10.0.1.107:554/ipcam_h264.sdp':f=0/0   
  Metadata:
    title           : IPCam
  Duration: N/A, start: 0.041667, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 1280x720, 24 fps, 24 tbr, 90k tbn, 180k tbc

Your post is from Aug.14 do you allready have a solution for it?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-08-10 10:50:55 -0600

Seen: 7,303 times

Last updated: Jul 13 '15