R
R
Roma2014-02-26 10:58:14
linux
Roma, 2014-02-26 10:58:14

How to stream video from a camera (rtsp/mjpeg) to a website (mms/wmv1)?

Hello colleagues.
There is a D-Link DCS-2230 camera, which gives an rtsp stream with sound. You need to stream it to a site that is on Bitrix with the Windows Media Player plugin.
avprobe says the stream formats are:

Stream #0.0: Video: mjpeg, 1k tbr, 90k tbn, 90k tbc
Stream #0.1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s

Send to the site (plugin), preferably, video in WMV1 and audio in mpga via mms.
Now I'm trying to overcome avconv + avserver, but so far not very successful.
While I'm running this configuration (test):
/etc/avserver.conf
Port 8080
BindAddress 0.0.0.0
MaxClients 200
MaxBandwidth 20000
CustomLog /var/log/avserver.log

<Feed feed1.ffm>
    File /tmp/feed1.ffm
    FileMaxSize 3M
    ACL allow 127.0.0.1
    ACL allow 10.1.129.18
    ACL allow 10.1.1.131
</Feed>
<Stream test1.mpg>
    Feed feed1.ffm
    Format mpeg
    AudioBitRate 128
    AudioChannels 1
    AudioSampleRate 16000
    VideoSize hd720
    VideoQMin 1
    VideoQMax 5
    Preroll 2
</Stream>

# avserver && avconv -f rtsp -i rtsp://10.1.1.36:554/live1.sdp \
 -acodec copy -vcodec copy http://10.1.1.131:8080/feed1.ffm

Input #0, rtsp, from 'rtsp://10.1.1.36:554/live1.sdp':
  Metadata:
    title           : RTSP/RTP stream 1 from cab253
    comment         : live1.sdp with v2.0
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, 15k tbr, 90k tbn, 90k tbc
    Stream #0.1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
Output #0, ffm, to 'http://10.1.1.131:8080/feed1.ffm':
  Metadata:
    title           : RTSP/RTP stream 1 from cab253
    comment         : live1.sdp with v2.0
    encoder         : Lavf53.21.1
    Stream #0.0: Audio: pcm_mulaw, 8000 Hz, 1 channels, 64 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
Press ctrl-c to stop encoding
^Csize=     240kB time=29.31 bitrate=  67.1kbits/s
video:0kB audio:229kB global headers:0kB muxing overhead 4.803493%

As you can see, streaming has started ... But the output is empty ... avconv swears that mjpeg is not supported
[mjpeg @ 0x1061be0] Found EOI before any SOF, ignoring
[mjpeg @ 0x1061be0] No JPEG data found in image
[mjpeg @ 0x1061be0] mjpeg: unsupported coding type (ca)
[mjpeg @ 0x1061be0] [IMGUTILS @ 0x7fff17eef1b0] Picture size 46022x42308 is invalid

did not understand... How to implement this support?
I also tried it through the mpeg4 stream, the same thing ... There is no swearing, but the output is empty.
Stream #0.0: Video: mpeg4 (Simple Profile), yuv420p, 480x270 [PAR 1:1 DAR 16:9], 1k tbr, 90k tbn, 30k tbc
Stream #0.1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s

To check from my computer, I try to watch the stream through VLC, just a blank screen ... If I connect VLC to the camera, then there is a picture.
How can the scheme described above be implemented? Very desirable on OpenSource, without java and xserver (vlc streams, but it requires x).
I still don’t understand whether avconv can receive (rtsp / mjpeg) / send (mms / wmv1) streams in the named formats?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kenny_opennix, 2014-02-26
@kenny_opennix

ffmpeg can.

R
Roma, 2014-02-26
@Angel2S2

@victor1234 the camera doesn't look outside and I can't do it, unfortunately (for a number of reasons beyond my control). Yes, there is (in the camera it is indicated as Mode) JPEG, MPEG4, H.264. C JPEG avplay does not output anything. With MPEG4 and H.264 the picture is blurry.
MPEG4
H.264
At the same time, VLC gives a normal picture.
Through avserver + avconv the result does not change - the output is empty.
Streaming with MPEG4 and H.264:
MPEG4
H.264

video:7636kB audio:1612kB global headers:0kB muxing overhead 1.987552%

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question