Giter VIP home page Giter VIP logo

Comments (21)

jacobbo avatar jacobbo commented on August 27, 2024

Hi,

Is if 6 seconds in the beginning of the stream, i.e. the first frame appears 6 seconds later after you press the Play button?

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

To build the C++ part of the control you will need to build FFmpeg and boost first. The instructions are here: #33 (comment)

from webeye.

withtypes avatar withtypes commented on August 27, 2024

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

You could try your stream with ffplay: https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20171128-86cead5-win64-static.zip

from webeye.

frankpc3 avatar frankpc3 commented on August 27, 2024

There is no delay on the StreamPlayer. I run my cameras into Blue Iris and I use the StreamPlayer control to play the video from BI on the desktop. Within a quarter of a second from the time motion is detected, the video begins to play. However, I first used StreamPlayer to play the video directly from the camera. When you try that, the video does not fully display until the I frame shows up. That just doesn't work. But the problem isn't with StreamPlayer control, it is with the process of starting the camera and trying to sync the video. And I doubt it would make a difference as to which camera you use. Not sure about that. But I did have the same problem with 5 different brands of cameras.

from webeye.

withtypes avatar withtypes commented on August 27, 2024

@jacobbo in theory, could I force the frame queue (ConcurrentQueue queue_) to skip "stale" frames e.g. after pop I empty it (or leave one frame at most) and only after that I take sleep_for(interframeDelay)?

This way I might skip some frames but it would always show the latest frame? What do you think? I will try to recompile StreamPlayer and replace .dll

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

Your idea is that for the first 6 seconds the stream has 'stale' frames, isn't? But then it's not a control's issue, that's a stream's issue.

Regarding your question, yes, you can skip frames, but this will be a very custom solution and you need a criteria based on which you will be skipping frames.

from webeye.

withtypes avatar withtypes commented on August 27, 2024

Sorry to bother you but I would like to try out that solution but I cannot get ffmpeg to compile. I've followed the instructions you provided as well as their guide https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC

$ make CC libavformat/mxfenc.o mxfenc.c libavformat/mxfenc.c(1447): error C2059: syntax error: '}' make: *** [libavformat/mxfenc.o] Error 2

Which seems like c99 syntax problem. But they mentioned this is something to worry about only on <2012 MSVC

Do you have any advice maybe how to simplify the build procedure? I tried to find pre-compiled binaries of boost/ffmpeg and try with them.

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

I do not remember such an issue. Which tools are you using to build it? I successfully build it using MSVC 2015 + MSYS + YASM x64.

Pre-compiled binaries will not work, as I use static linking for FFmpeg.

from webeye.

withtypes avatar withtypes commented on August 27, 2024

I fixed the compilation issue and managed to compile ffmpeg with ./configure --toolchain=msvc --arch=amd64 --target-os=win64 --enable-version3 --enable-static --disable-shared --disable-programs --disable-doc and make

I've added everything into VC++ Directories (Library/Include) for Release x64. Still I cannot get it to compile, it says Severity Code Description Project File Line Suppression State Error LNK1104 cannot open file 'libpostproc.a' StreamPlayer C:\Users\Hrvoje\work\WebEye\StreamPlayerControl\StreamPlayer\StreamPlayer\LINK .

I cannot find .a files anywhere. I would expect them after compiling ffmpeg with the static option :(

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

That's correct, the .a files should be generated by make.

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

btw, have you tried ffplay?

from webeye.

withtypes avatar withtypes commented on August 27, 2024

I did, there is a lag also (2 seconds).

Tail:
[h264 @ 000000000289b720] concealing 1245 DC, 1245 AC, 1245 MV errors in I frame
[rtsp @ 00000000027e8b20] max delay reached. need to consume packet
[rtsp @ 00000000027e8b20] RTP: missed 34 packets
[h264 @ 00000000038835e0] negative number of zero coeffs at 18 45
[h264 @ 00000000038835e0] error while decoding MB 18 45
[h264 @ 00000000038835e0] concealing 2791 DC, 2791 AC, 2791 MV errors in I frame
[rtsp @ 00000000027e8b20] max delay reached. need to consume packet
[rtsp @ 00000000027e8b20] RTP: missed 25 packets
[h264 @ 0000000003883d60] corrupted macroblock 51 54 (total_coeff=-1)
[h264 @ 0000000003883d60] error while decoding MB 51 54 0B f=1/1
[h264 @ 0000000003883d60] concealing 1678 DC, 1678 AC, 1678 MV errors in I frame
[rtsp @ 00000000027e8b20] max delay reached. need to consume packet
[rtsp @ 00000000027e8b20] RTP: missed 36 packets
[h264 @ 0000000003a20380] corrupted macroblock 8 43 (total_coeff=-1)
[h264 @ 0000000003a20380] error while decoding MB 8 43
[h264 @ 0000000003a20380] concealing 3041 DC, 3041 AC, 3041 MV errors in I frame
[rtsp @ 00000000027e8b20] max delay reached. need to consume packet
[rtsp @ 00000000027e8b20] RTP: missed 30 packets
[h264 @ 0000000003ce56a0] negative number of zero coeffs at 38 47
[h264 @ 0000000003ce56a0] error while decoding MB 38 47
[h264 @ 0000000003ce56a0] concealing 2531 DC, 2531 AC, 2531 MV errors in I frame
35.56 M-V: -0.112 fd= 7 aq= 0KB vq= 0KB sq= 0B f=1/1

from webeye.

withtypes avatar withtypes commented on August 27, 2024

Running ffplay -rtsp_transport tcp -probesize 32 makes it better.

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

I see. The control supports setting the rtsp_transport option, but doesn't support the probesize option.
You could try to create a custom build with hardcoded probesize setting. I think, you just need to add it to the dictionary in the Stream::GetOptions() method

av_dict_set(&optionsPtr, "rtsp_transport", "tcp", 0);

from webeye.

withtypes avatar withtypes commented on August 27, 2024

But I don't understand ffmpeg, I did configure ..., make, make install shouldn't .a files be in the same directory (under respective subdirs)?

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

'make install' is not needed, just 'make' is enough in my case. Also, make produces logging info, you could forward it to a file and find out what's going on.

from webeye.

withtypes avatar withtypes commented on August 27, 2024

Ah libpostproc was the problem. It's GPL so I had to add --enable-gpl to configure! You can update it in that procedure if you want...

Let't me try probe now!

from webeye.

withtypes avatar withtypes commented on August 27, 2024

Probe helped a little bit but in the end I removed that sleep and now it works <1s lag!

from webeye.

jacobbo avatar jacobbo commented on August 27, 2024

You mentioned that some other players handle your stream correctly, i.e. without the lag.
I'm wondering what are they? Software that comes with camera?

from webeye.

withtypes avatar withtypes commented on August 27, 2024

from webeye.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.