Streaming problems - how to use the html generated code


#1

Hi

I have been trying to setup a live streaming webcamera via Netcam Studio X(1.3.6.8). I can get the still pictures on my website but streaming does not work. I have tried to stream via VLC and via my website with the help of code that Netcam Studio generated but no luck.

I use webcamXP too and it works flawless.

Any suggestions?


#2

Hi Bo!
Since you write webcam I assume you mean an USB connected webcam. In the download section of NCS there is this text “Some USB cameras may work only with the 32-bit version!” so please download the 32-bit version and test if that works better.
-Henrik


#3

Hi Henrik!

Thank you for a quick reply, I am using 32bit version.
-Bo


#4

Which web browser do you use? IE, Chrome, Firefox? Firefox is usually the one that works best, but test. Does it works when you connect using the web client?
-Henrik


#5

I tried IE, Chrome and Firefox. No luck. I can only see a still picture from my webcam.
webcam

It does work if I connect via web client but the purpose of webcam is that it should be available for everyone.

-Bo


#6

Yes, of cause. Just checking for possible problems ;).
I have a webcam connected to NCS as source 0. In Settings - Generate HTML for source 0 and MJPEG I get this URL:
http://127.0.0.1:8100/Mjpeg/0?authToken=c11b684d-83f9-480c-ba58-d0aae3363068
I paste that into Firefox and Chrome and VLC and it streams. I never get anything to work with IE ;).
In Settings - Decoding/Encoding - Streaming Settings Live I have H264_NOAUDIO

When I check your html code I see only the code for the jpeg. I copied your http://xxxxx:8100/ and changed jpeg to mjpeg and it streams very fine here in Brazil with 9 FPS ;). Do not use the Admin account for this since that Token will expire after some time. Create a user account only with access to this cam.

Trevlig websida! Det börjar mörkna i Sverige på kvällarna nu.

Lyclka till hälsar Henrik!


#7

I tried with settings you suggested, changed to user token with only view source 0 privileges and now it shows “broken image” icon on my website
if I use IE or Chrome.If I use Firefox it works. :slight_smile:

But…visitors on the website use IE and Chrome and maybe 3% use Firefox :worried:
Strangely webcamXP works flawless on the same website, maybe it is possible to tweak and copy/paste javascript that webcamXP generates?

Ja det börjar bli mörkt nu på kvällar iaf här i Skåne.
Brasilien är nice snart börjar OS :slight_smile:


#8

Unfortunately, I have to say that I have no idea why it works in Firefox and not in IE and Chrome. It is some setting or … Always problem with IE ;).
I have to ask our expetise about why Generated HTML code do not work in IE and Chrome. It is probably very easy … Sorry for this. If I go back here in the forum we have had this before, bu then it was only problem with IE.
@Steve
-Henrik


#9

Can you please either post your code here or a link to webpage or send it by private message.

Did you create a new user account (not the admin one) because you cannot use the token from the admin account (it changes every time the software restarts).


#10

i have found the link to the page.

so what i see:

  • The auth token is ok (i can use it to retrieve jpeg image)
  • It’s just the mjpeg that is corrupted, as an easy workaround if you generate code targeting JPEG mode instead of MJPEG mode then it will probably work (since it will use the same approach as webcamXP does).

However there have been some fixes related to mjpeg to improve compatibility across browsers in the 1.3.7 which is not officially released but available in this thread:


#11

or here for the 32-bit version in case you want to use the MJPEG mode:

I suppose that it will also fix the problem on your end…


#12

Hi Steve

Thank you for your reply.

I have followed you instructions, downloaded 1.3.7 version and now the mjpeg stream works but only in Chrome and Edge.
Changing to jpeg breaks the stream across all webbrowsers.

Then I tried webcamXP again and the javascript generated worked flawless in IE, Edge, Firefox and Chrome

I am no expert in javascript but the difference between the script generated in webcamXP and Netcam Studio - just by
looking at the lenght of script is noticeable.
-Bo


#13

Can you please post here the html code generated when you select “JPEG” before generating the code ?


#14

I am not sure what you mean…:confused:

This is the JPEG code generated by Netcam Studio(IP address is changed afterwards to a DDNS address) then i copy/paste the code
on my website.


#15

Tried pasting the code but it fails for some reason so here is text file with jpeg code:
https://1drv.ms/t/s!ArXUU6d4L3BIgYFoVM8xxNVidOAOgw


#16

Your code and token are ok, the only problem is that it targets 127.0.0.1 instead of your website: abcdef.zapto.org

If i replace 127.0.0.1 with your ncs server address then it’s ok and working.


#18

For all of us that need some help with this :wink: I have tested the following and it works fine in IE, Firefox and Chrome. Do the following In NCS 137.

  1. Create a user account that have access only to the cam you want to publish on the Internet.
  2. Go to Settings and Generate HTML. Select the video source that you want to stream that corresponds to the user account.
  3. Select Stream type: Jpeg.
  4. Select User Token to use for authentication: select the actual user account. This is a permanent Token that will not change at a restart. The Token for the Admin account will change when NCS is restarted so do not use that.
  5. Copy the complete code and paste it as html code using your favorite html editor.
  6. You will probably have this URL http://127.0.0.1:8100 in the code. Change that to the relevant URL for your application and system.
  7. Publish and test. This worked fine for me and video streams as expected in IE, Firefox and Chrome.
  8. To also get the sound is for another day :slight_smile:
    -Henrik

#19

Still I can’t get it to work(on my website) in Firefox and IE. Maybe it’s some kind of a Wordpress and Javascript issue.


#20

Aha, so you use Wordpress. A quick seach for embed webcam in WP seems to be some more things to be solved. I am not using WP, but you are certainly not the only one doing this. Cant you just skip WP and generate a standard html page and upload to your webhotel just for testing.


#21

Sorry for a slow reply, I have tested now with a standard html page and it works in all browsers.
WP page - works only in Chrome and Edge