Help connecting to rtsp stream using javacv

872 views
Skip to first unread message

jain...@gmail.com

unread,
Dec 23, 2014, 4:54:42 PM12/23/14
to jav...@googlegroups.com
I am new to Javacv and have been trying to connect to my zmodo security camera.  I was able to properly setup the javacv environment and able to load files locally.  However, connecting to camera is failing.  I verified the rtsp url using VLC and it worked.  However, I am unable to connect using FFmpegFrameGrabber.  Will appreciate your help to resolve the issue.  Program snippet and error returned are shown below.

Program snippet:
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber("rtsp://admin:111...@10.0.0.8:10554/tcp/av0_0");
grabber.start();
IplImage frame = grabber.grab();
if (frame == null){
System.out.println("No Frame returned ..... ");
}else{
System.out.println("Frame returned ");
}
grabber.stop();

Error returned:
No Frame returned ..... 
[rtsp @ 000000000064dd60] CSeq 5 expected, 0 received.
[rtsp @ 000000000064dd60] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://admin:111...@10.0.0.8:10554/tcp/av0_0':
  Metadata:
    title           : streamed by the Zmodo RTSP server
  Duration: N/A, start: 0.000000, bitrate: 64 kb/s
    Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
[IMGUTILS @ 000000000293eea0] Picture size 0x720 is invalid
[IMGUTILS @ 000000000293ee10] Picture size 0x720 is invalid


Samuel Audet

unread,
Dec 27, 2014, 5:07:49 AM12/27/14
to jav...@googlegroups.com
On 12/24/2014 06:54 AM, jain...@gmail.com wrote:
> I am new to Javacv and have been trying to connect to my zmodo security
> camera. I was able to properly setup the javacv environment and able to
> load files locally. However, connecting to camera is failing. I
> verified the rtsp url using VLC and it worked. However, I am unable to
> connect using FFmpegFrameGrabber. Will appreciate your help to resolve
> the issue. Program snippet and error returned are shown below.

Sounds like a bug in FFmpeg. JavaCV 0.10 comes with a much newer version
of FFmpeg, so please try again with version 0.10! Thanks

Samuel

jain...@gmail.com

unread,
Dec 27, 2014, 6:56:11 PM12/27/14
to jav...@googlegroups.com
Thank You Samuel for your reply.  However, I am using JavaCV 0.10 and the ffmpeg version is 2.5.1. and am seeing the issue.  What is the best way to debug this issue?  Appreciate the guidance.

Thanks,
Jain

Samuel Audet

unread,
Dec 27, 2014, 7:05:22 PM12/27/14
to jav...@googlegroups.com
On 12/28/2014 08:56 AM, jain...@gmail.com wrote:
> Thank You Samuel for your reply. However, I am using JavaCV 0.10 and
> the ffmpeg version is 2.5.1. and am seeing the issue. What is the best
> way to debug this issue? Appreciate the guidance.

The error says to try to increase 'analyzeduration' and 'probesize'
options, so I guess we should be trying that. We'd have to modify
FFmpegFrameGrabber around `AVDictionary options` for that, which
shouldn't be too hard, but could you put this up as an issue on GitHub
so I don't forget?
https://github.com/bytedeco/javacv/issues
And of course if you create a patch yourself, please provide it! Thanks

Samuel

Reply all
Reply to author
Forward
0 new messages