• 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 15
Release Foscam HD - Video feed with camera controls, and motion/sound detection preview
(2014-11-10, 07:59)danillll Wrote: Hi Leo,

I am currently shopping for a baby monitor and was super excited when I read about your plugin until I got to the last couple of posts regarding the delay.

As you stated, the issue is not on the xbmc/addon side, it's in the RSTP on the server side (ie: the camera)

http://foscam.us/forum/high-def-performance-t8083.html

From the above link, the only solution is to access the stream directly and the fact that the sdk for the low level h.264 is not documented, I guess the only solution right now is to reverse engineer it.
I am not sure if this https://github.com/MStrecke/pyFosControl will be helpful.
Thanks for the links. I'll definitely look into it.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
Thanks Leo!

I am planning to order the camera by the end of this week and then I can start helping with development.

How bad is the audio, as I mentioned, I am planning to use it as a baby monitor , so audio is kinda crucial Smile
Are you using external mic? if yes, which kind? I also found this link http://foscam.us/forum/mic-preamplifier-...t9619.html but I am a software engineer haven't done any circuit work since college, so I wonder if it really works.
Reply
(2014-11-10, 21:44)danillll Wrote: Thanks Leo!

I am planning to order the camera by the end of this week and then I can start helping with development.

How bad is the audio, as I mentioned, I am planning to use it as a baby monitor , so audio is kinda crucial Smile
Are you using external mic? if yes, which kind? I also found this link http://foscam.us/forum/mic-preamplifier-...t9619.html but I am a software engineer haven't done any circuit work since college, so I wonder if it really works.

2 people developing, Sounds like a promising add on coming up Smile
Reply
(2014-11-10, 21:44)danillll Wrote: Thanks Leo!

I am planning to order the camera by the end of this week and then I can start helping with development.

How bad is the audio, as I mentioned, I am planning to use it as a baby monitor , so audio is kinda crucial Smile
Are you using external mic? if yes, which kind? I also found this link http://foscam.us/forum/mic-preamplifier-...t9619.html but I am a software engineer haven't done any circuit work since college, so I wonder if it really works.
I don't use an external mic as I generally rely on the motion/sound detection triggering the video preview. I like the idea of that though.
It would be great to have help with development as I don't have much free time to spend on this.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
(2014-11-10, 05:05)freddy12 Wrote:
(2014-11-09, 20:29)Leopold Wrote:
(2014-11-08, 08:07)freddy12 Wrote: yeah i ended up trying the advance settings but as you said makes no difference, theirs a big lag on the movement of the camera aswell using a fi9821w v2
Actually there's no lag on the movement of the camera. The camera responds to the commands instantly, you just won't see the movement instantly because of the video lag.

Makes sense. I didn't think about that, any luck with this mystery lag

An interesting thing happened this morning. I moved the camera and saw the effect almost instantly, i.e. there was almost zero video lag. I was running a very recent build of master on Linux. After a while I saw a buffering progress message which introduced a lag. Unfortunately the next time I started the addon I had a lag again. I am not using any advancedsettings. Can anyone else reproduce this zero lag using a recent build?

This leads me to believe that the lag is not from the camera and there may be some hope of eliminating it on the client side, assuming a sufficient network speed.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
(2014-11-13, 12:15)Leopold Wrote:
(2014-11-10, 05:05)freddy12 Wrote:
(2014-11-09, 20:29)Leopold Wrote: Actually there's no lag on the movement of the camera. The camera responds to the commands instantly, you just won't see the movement instantly because of the video lag.

Makes sense. I didn't think about that, any luck with this mystery lag

An interesting thing happened this morning. I moved the camera and saw the effect almost instantly, i.e. there was almost zero video lag. I was running a very recent build of master on Linux. After a while I saw a buffering progress message which introduced a lag. Unfortunately the next time I started the addon I had a lag again. I am not using any advancedsettings. Can anyone else reproduce this zero lag using a recent build?

This leads me to believe that the lag is not from the camera and there may be some hope of eliminating it on the client side, assuming a sufficient network speed.

Intresting! Ordered my camera last night after our anatomy scan went fine Smile I will start testing as soon as I get it.
I also ordered http://www.amazon.com/gp/product/B00029M...UTF8&psc=1 to see if it helps with the audio, I am really intrested in building the circuit preamp mic I mentioned earlier, but not sure if time would allow.

As for the rtsp lag, are you referring to xbmc latest build or the OS where xbmc is running?
Can you try the rtsp link outside xbmc, using ffmpeg or VLC to see if the lag exists?
Reply
(2014-11-13, 18:17)danillll Wrote: As for the rtsp lag, are you referring to xbmc latest build or the OS where xbmc is running?
xbmc latest build. I compiled xbmc from git master branch.

(2014-11-13, 18:17)danillll Wrote: Can you try the rtsp link outside xbmc, using ffmpeg or VLC to see if the lag exists?
Yes I looked at the stream this morning using ffplay and there was a lag. I'll keep an eye on it over the next few days.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
Did you try to reduce the stream resolution to see if it would help?

Quote:"Adding "&resolution=8&rate=13" really helps with the latency at the cost of some resolution, though. "

Found it here.
http://forum.kodi.tv/showthread.php?tid=...pid1422488

As for the ffplay looks like it has a harcoded cache in it, can you try mplayer with the -nocache , ffmpeg also has an option to ignore caching
Reply
Which firmware are you running on the camera?
Reply
V-2.x.1.116-20141020 on FI9821W V2
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
@Leopold

Got the camera and have been experimenting with it, here is what I found so far:

1) Windows vendor (foscam) plugin, less than half a second to no lag
2) Baby Monitor for ip camera (IOS) and Tiny Cam (Android) works really well, less than a second lag.
3) 3 seconds delay with your XBMC FOSCAM Addon, based on the below, I concluded that the lag is caused by xbmc, most likely ffmpeg.

Log was set to debug and captured when I first launched the addon, notice the 3 seconds delay:

00:58:26 T:2554329920 DEBUG: ffmpeg[983FFB40]: [rtsp] hello state=0
00:58:26 T:2554329920 DEBUG: Open - avformat_find_stream_info starting
00:58:26 T:3006756672 DEBUG: ------ Window Init (DialogBusy.xml) ------
00:58:26 T:2554329920 ERROR: ffmpeg[983FFB40]: [h264] Missing reference picture, default is 0
00:58:26 T:2554329920 ERROR: ffmpeg[983FFB40]: [h264] decode_slice_header error
00:58:29 T:2554329920 DEBUG: ffmpeg[983FFB40]: [rtsp] All info .......
............

Interestingly enough, after the video is launched, I can fast forward through the 3 seconds and then hit play and boom, I am in sync with barely any delays.
To me, it looks like ffmpeg is the one adding this delay.

I will poke around little bit more and see what I can find.
Reply
@leopard

I found a workaround that helped to reduce the lag to less than a second.

As I mentioned in my previous post, it was taking xbmc 3 seconds to render the stream and fast forwarding through the buffer helped me catch up the live stream.
So I changed the default.py and invoked xbmc.Player.seekTime with a 4 seconds value ( any value larger than the delay you are seeing on your machine)


70a71
> self.player.seekTime(4)


Let me know if this worked for you
Reply
Could you share the new files with the changes for us less tech savy people to try?
Reply
@freddy12

I forked the branch and committed the one liner.
Make sure to use the below branch (delay_take_one)
https://github.com/danilll/script.foscam...y_take_one

IF you want to see the diff: https://github.com/danilll/script.foscam...650efee43d

I set the seek to 6 seconds, which is high enough for my setup as the delay for me was around 3-4 seconds, if your delay is larger than 5, make sure to increase the seek value by editing the file I pointed out manually.

Once you confirm that it's working, I will submit a pull request so Leopard commits the change.
Reply
(2014-11-18, 04:37)danillll Wrote: @freddy12

I forked the branch and committed the one liner.
Make sure to use the below branch (delay_take_one)
https://github.com/danilll/script.foscam...y_take_one

IF you want to see the diff: https://github.com/danilll/script.foscam...650efee43d

I set the seek to 6 seconds, which is high enough for my setup as the delay for me was around 3-4 seconds, if your delay is larger than 5, make sure to increase the seek value by editing the file I pointed out manually.

Once you confirm that it's working, I will submit a pull request so Leopard commits the change.

i still have a delay, mines at my door someone will shut the door and acouple seconds later itll happen on the video.... what firmware version are you running?
Reply
  • 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 15

Logout Mark Read Team Forum Stats Members Help
Foscam HD - Video feed with camera controls, and motion/sound detection preview1