VLC streaming with ip camera - reconnect when camera resets - camera

I am using VLC to get the video stream from my ip cam and stream it to the network, in order to save the limited wifi band that reaches the cam. The command I use to do this is as follows:
cvlc [cam stream] --sout "#standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:[chosen port]}"
The problem is that when the camera restarts neither VLC quits nor it reconnects to it, so I cannot run it again. Does anyone have an idea on how to sove this? Any help will be very appreciated.

Got it working by writing a script that periodically connects to the vlc instance via TELNET, checks the ammount of bytes received and saves it into a log file. In case the ammount of bytes is equal to the last time it checked, it sends a stop then a play command to VLC and, if the camera is back online it will work again. If anyone wants more details about the implementation, just ask!

Related

HDMI Splitter taking Input from Mac into capture card shutting off a channel

Hey so what I'm trying to do is take HDMI input (from a computer) to a splitter from which one channel goes to some viewing device (projector or something) while the other channel goes through a capture card into another system for some processing that I'm doing. However, four seconds after I connect my capture card to one of the splitter's output channels the splitter just stops outputting on that channel and essentially shuts that channel off (as seen by the LED on it). However, if I connect a projector to the other output channel it stays working fine on that.
Keep in mind that the input I'm using is from a MacBook Pro. When I switch the input to an Xbox 360 everything works absolutely fine. Also, if I connect the input (MacBook) directly to the system bypassing the splitter it works absolutely fine. Can someone explain what might be going wrong here when I put the splitter in the mix?
Here is the equipment that I'm using:
Splitter: http://www.gofanco.com/2-port-hdmi-splitter-4k-black-splitter2p.html
Capture Card: https://www.amazon.com/Video-Capture-Device-1080P-Grabber/dp/B01N4SM7H6/ref=sr_1_7?ie=UTF8&qid=1522955789&sr=8-7&keywords=full+hd+video+capture
Any help would be greatly appreciated :)
I would guess this may be an EDID issue. A display or capture device negotiates the best resolution and frame rate via EDID with your graphics card.
Now if you put the splitter in between the EDID based communication can go sideways.
HDCP could be another reason. Your splitter may not correctly handle or advertise HDCP

Raspberry camera error: "mmal: No data received from sensor"

I used successfully my raspberry camera times ago.
Now I tried again to acquire a image with the raspistill -o image.jpg command; the red led on the camera flashes, but I get this error:
mmal: No data received from sensor.
Check all connections, including the Sunny one on the camera board
Of course the camera connections are fine. Is there any other way to check if the camera is still working?
This error usually appears because of a faulty connection with the camera.
I had the exact same problem in different camera+Pi configurations. The following case is what I encountered:
The connector is not correctly inserted either in the camera or in the Pi.
The Sunny connector (the small yellow one on the camera) is not connected well.
(now it gets interesting)
If you often remove and reinsert the camera in the Pi please be sure to remove all power from the Pi. The sensor is very sensitive and a spark on the wrong pin could burn it. (I did this already unfortunately)
This could also trigger a problem with the Pi connector pins. It was somewhat confirmed that for Pi2 the connector may have some bad soldering which could lead to cold contact soldering. You can fix this by using some flux on the pins and then pass the soldering iron hot end over the pins to remake the connection.
I used a longer cable that had both connectors on the same side of the cable. If you connect it like it is you can burn your sensor and the Pi will not start because of the power surge (also the camera gets very hot in this case). DO NOT REMOVE IT from the Pi without removing power before. To a cable like this you have to remove the blue plastic from one end and bend the connector with the contacts on the other side. Insert this end in the camera since this will not be removed/inserted as often as the Pi end.
Make sure that the silver contacts are well inserted into the PCB connector.
(video here)
Also, make sure that the sunny connector is firmly attached.
This fixed it for me.
I was experiencing the same problem too, until I found a solution.
I removed the sunny connector(the yellow thingy below the camera in the board) and fixed it in the same place. The camera is working fine after trying this.
I have got the same issue. I have find out it was a power supply issue.
Try to change your cable and/or your raspberry power supply adaptor.
You check if this is your reason of your problem by typing:
$ dmesg
if you see something like this:
[ 44.152029] Under-voltage detected! (0x00050005)
-> Then replace your power supply! :D
The only fix for me was to purchase a new camera.
No real root causes identified.
My problem was I put the camera in, while the Pi was on. which might
have made the camera shot. i.e the camera module is static sensitive
and it's possible that it's been damaged
Unfortunately if this is the case there's nothing you can realistically do to fix it, just get a replacement.
This specific error shows when another application is using the camera. In my case, it was motion.
It might be possible that the cable is placed the wrong way. I had this problem and after multiple tries I realized that was the problem.

streaming webcam output over the internet using UDP protocol

I want to stream webcam output over the internet using UDP protocol (RTP to be specific). But I don’t have any ideas how to start to do so.
I have already tried using Microsoft DirectShow to get every frame as a jpeg file. I tried to send it using UDP but it was very slow.
I hope you could point me to the right direction .Also, if there are open source applications in java or c# that does this I will be very happy to work on them.
Thanks in advance
I am pretty sure that VLC (http://www.videolan.org/vlc/index.html) can do RTP.
Media menu
Stream...
Capture device tab
Set up as appropriate
Stream button
Next button
Change the "new destination" drop down to one of the RTP options
after this, I don't know, because I've never used RTP.
Good luck!

how to stream live webcam in unity 3d?

At the moment i am being able to see my own webcam in unity3d as a texture using this simple tutorial
http://www.ikriz.nl/2011/12/23/unity-video-remake
Now i want to know that how can i see someone's else webcam in unity 3d?
can any body give me some pointers?
What do you mean under 'someone's else webcam'? Actually you can open socket connection between two computers, stream 'someone's else' webcam via socket and show a picture in your application.
An application for 'someone's else' can be written in any language/framework.
To help any one who would find this helpful in future, i have done this by using a flash client that takes the live stream and send it to a local server which was written in .Net.
and that .net server then sends the stream to our script which was running in unity3D. and that script was placed on any plane in your model , so showing you the received stream.
It was a bit laggy but it was working :)

zte voice modem problem

we are using zte usb modem. we try to call by AT command (ATD) successfully. But there is no sound when remote device answered.
Does anyone have any idea?
My problem was associated with ZTE usb modem.
I solved the problem.
i can receive and send voice separately to voice port now. But i can not get clean sound like WCDMA UI.
how can i receive and send data with high quality?
Please look at my source code. [http://serv7.boxca.com/files/0/z9g2d59a8rtw6n/ModemDial.zip]
Does anyone now where is my error?
Thank you for your time.
a) Not all zte usb modems supports voice, to detect if modem supports check for ZTE voUSB Device in your ports list.
b) If port present, voice will go through it in pcm format, with 64kbps frequency (8000 samples per sec, 8 sample size).
In your own program, you should read audio stream from there.
stream is additionaly encoded with g.711, so you need to decode it before sending to audio device
It is fairly common to shut off the speaker after connection. Try sending ATM2, that should make the speaker always on.
Basic hayes command set:
M2
Speaker always on (data sounds are heard after CONNECT)
I'm trying to use asterisk's chan_dongle module on ZTE MF180 Datacard model with activated voices abilities.
Originally chan_dongle using raw PCM format on voice data.
But i was discover, that ZTE using ulaw format on sending and recciving voice data.
You can get voice data and save file in this format for learn by using standard Asterisk's Record(filename:ulaw) command in dialplan.
My voice data, dumped from ZTE modem in the same format.
I check it. ZTE dumped data was successefully played by Asterisk's command Playback(dumped)