Reputation: 43
I'm programming a small software for the remote use of a Sony camera (I use QX1 but the model should be irrelevant) in VB.net. I could make pictures by sending the JSON-commands to the camera and also could start the liveview-stream with the method "startLiveview" wrapped in a JSON-command. In return I get the address to download the livestream, like http://192.168.122.1:8080/liveview/liveviewstream (wrapped in a JSON-answer).
According to the Sony CameraRemote-API-reference this is a stream which contains some header-data and the single jpeg-data. But it seems not to be a MJPEG-stream. I could past the livestream-link to my browser and it starts to infinitely download the livestream. I could not show the stream with a MJPEG-stream player like VLC.
My question is, how can I filter out the jpeg-data with VB.net or how can I show the livestream.
A similar question was already posted at an older question but without any reply. Therefore I'm trying it again.
Upvotes: 3
Views: 3733
Reputation: 11
(I use my laptop with linux in a terminal)
sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
fix the parameters of your camera to enable the control via Smartphone, for example the ssd of my camera on my network is DIRECT-dpC3:DSC-RX100M5A
Use Wifi to connect your computer directly to your camera
Tell your camera to begin liveView with this command:
curl http://192.168.122.1:10000/sony/camera -X POST -H 'Content- type:application/json' --data '{ "method": "startLiveview", "params": [], "id": 1, "version": "1.0"}'
Note the response of the camera is an URL: mine is:
{"id":1,"result":["http://192.168.122.1:60152/liveviewstream?%211234%21%2a%3a%2a%3aimage%2fjpeg%3a%2a%21%21%21%21%21"]}
Tell gstreamer to use this URL:
gst-launch-1.0 souphttpsrc location=http://192.168.122.1:60152/liveviewstream?%211234%21%2a%3a%2a%3aimage%2fjpeg%3a%2a%21%21%21%21%21 ! jpegdec ! autovideosink
7; Enjoy ;-)
Upvotes: 1
Reputation: 1
In VLC works for me adding .mjpg to URL try this. Wait for sec and should be played http://192.168.122.1:8080/liveview/liveviewstream.mjpg
Upvotes: 0
Reputation: 21
This is my way, I use ffserver to make the video stream-able. this is myconfig for ffserver config (server.conf):
Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000
CustomLog -
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 1G
ACL allow 127.0.0.1
</Feed>
<Stream cam.webm>
Feed feed1.ffm
Format webm
VideoCodec libvpx
VideoSize vga
VideoFrameRate 25
AVOptionVideo flags +global_header
StartSendOnKey
NoAudio
preroll 5
VideoBitRate 400
</Stream>
<Stream status.html>
Format status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>
And then I run the ffserver with that config:
ffserver -f server.conf
And then encode the video from sony liveview, and broadcast via ffserver:
ffmpeg -i http://192.168.122.1:8080/liveview/liveviewstream -vcodec libvpx -fflags nobuffer -an http://127.0.0.1:8090/feed1.ffm
After that you can stream liveview from the address
localhost:8090/cam.webm
Upvotes: 2
Reputation: 21
I try to use ffmpeg to process the streaming, and success to save streaming as flv file. I use this code on terminal (I use UNIX) and I success save the file as flv file:
ffmpeg -i http://192.168.122.1:8080/liveview/liveviewstream -vcodec flv -qscale 1 -an output.flv
Maybe you can modify or optimize it as you needed.
Upvotes: 0