Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not open Mobotix Stream when a timeout is set #165

Closed
rpgomes opened this issue Jun 25, 2015 · 14 comments
Closed

Could not open Mobotix Stream when a timeout is set #165

rpgomes opened this issue Jun 25, 2015 · 14 comments
Labels

Comments

@rpgomes
Copy link

rpgomes commented Jun 25, 2015

Hello,

I having a strange behavior when testing to get the video Stream of a Mobotix camera, I'm using javaCV 0.11.
When I set a timeout I can't open the stream, the stream only open if I don't set the timeout parameter.

I verified this behavior with javaCV 0.11 and Java CV 0.11 in version 0.9 and 0.8 it works with the timeout.

My code is the following:

grabber = new FFmpegFrameGrabber("http://IP//control/faststream.jpg?stream=mxg&fps=10");
grabber.setFormat("mxg");
grabber.setVideoOption("timeout", "5000000");
grab.start()

When the stream is open it timeout at 0, the following dump format appears:

nput #0, mxg, from 'http://IP/control/faststream.jpg?str
eam=mxg&fps=10':
Duration: N/A, start: 1435231794.877011, bitrate: 64 kb/s
Stream #0:0: Video: mxpeg, yuvj420p(pc, bt470bg), 1024x768, 50.08 tbr, 1000k
tbn, 1000k tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s

the function av_strerror retruns the following error:
Error number -138 occurred

What can I do to set a timeout to this stream?

@rpgomes rpgomes changed the title Could not open Mobotix Stream When I defined a timeout Could not open Mobotix Stream when a timeout is set Jun 25, 2015
@saudet
Copy link
Member

saudet commented Jun 25, 2015

I don't know, that would something to ask the developers of FFmpeg I guess.

@rpgomes
Copy link
Author

rpgomes commented Jun 25, 2015

Wich version of FFmpeg are your project using for version 0.10 and 0.11?
This problem only happens whit that versions.
When I try it the latest build outside javacv it works.

@saudet
Copy link
Member

saudet commented Jun 25, 2015

So could try to build from the latest source? It will build with the latest version of FFmpeg.

@rpgomes
Copy link
Author

rpgomes commented Jun 25, 2015

OK.

Do you have some instructions to build the ffmpeg.jar and ffmpeg-windows-x86.jar.

@rpgomes
Copy link
Author

rpgomes commented Jun 25, 2015

Hi saudet, sorry for insisting, I never compiled something so complex (at least for me)

If I follow this instructions
https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets

I manage to build the ffmpeg.jar and ffmpeg-windows-x86.jar ?
If I understand what you said when I build the jar it already had the lattest ffmpeg version?
Where can I see the version of the FFMPEG that are in the javaCV builds?

@saudet
Copy link
Member

saudet commented Jun 25, 2015 via email

@rpgomes
Copy link
Author

rpgomes commented Jun 26, 2015

OK,

I will try to compile.
Meanwhile do you know at error -138 mean in avformat_open_input

@saudet
Copy link
Member

saudet commented Jun 26, 2015

Use the av_strerror() to get a description.

@rpgomes
Copy link
Author

rpgomes commented Jun 26, 2015

I try that
I got this description:
Error number -138 occurred

@saudet
Copy link
Member

saudet commented Jun 26, 2015

It looks like you're trying to use a 32-bit compiler with a 64-bit JDK: This won't work. Please read the README.md file.

@rpgomes
Copy link
Author

rpgomes commented Jun 29, 2015

I finally manage to compile a new FFMPEG.jar and the ffmpeg-windows-x86.jar

With the function avformat_version returning 3679332
I think is FFmpeg 2.7

I'm still getting the same behaviour, with the timeout parameter the stream does not open an return error -138 ( av_strerror() returns Error number -138 occurred)

If I use the FFMPEG.jar and the ffmpeg-windows-x86.jar in Javacv 0.8 release the stream opens.

What can I do to debug?

@saudet
Copy link
Member

saudet commented Jun 29, 2015 via email

@rpgomes
Copy link
Author

rpgomes commented Jun 30, 2015

OK, I find out my problem.

With your ffplay tip ;) I was setting the timeout in seconds, but this parameter is to be set in microseconds.

@saudet
Copy link
Member

saudet commented Jul 1, 2015

Ok, good, so I'm assuming everything works fine then? Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants