Rectangle 27 2

MPEG-TS streams support a limited number of audio codecs and PCM a-law appears not to be one of them.

AAC is accepted and can be used as follows:

ffmpeg -i rtsp://10.0.8.152:554/media/live/1/1 -c:a aac -c:v copy -hls_list_size 65535 -hls_time 2 "./live.m3u8"

video - FFMPEG no audio get recorded from RTSP stream - Stack Overflow

audio video ffmpeg rtsp
Rectangle 27 3

After some research it seems that Microsoft uses rtsp which is a variation of the rtp protocol. Fortunately ffmpeg supports muxing and demuxing in that format. https://www.ffmpeg.org/ffmpeg-protocols.html#rtsp . You may have to adjust the parameters outlined. If the server must be a vb6 frontend, you can have ffmpeg launched as the backend from the command line. This is a common method and I found an example of it here: https://www.ehow.com/how_6038708_use-ffmpeg-visual-basic-6.html for reference.

The next stage is the ability to play those streams in visual basic 6. What you can do is add a Windows Media Player control and set its property WindowsMediaPlayer1.URL to {a list with your url added to it as a string}. One version of control has a id of {6BF52A50-394A-11D3-B153-00C04F79FAA6} and the dll is wmp.dll. Make sure the control has autoStart & invokeURLs set to true.

Some other things worth mentioning is trying to use WMP compliant codecs and contains such as windows media video.

Thanks for taking time researching on this stuff. Your solution would be perfect except the fact that VB6 holds the connection. When FFMPEG broadcasts the live signal, it could only broadcast RTSP locally but VB6 is the one that transfer the signal over the internet to the other end. So, do you have any trick to make VB6 redirect a local rtsp protocol through internet to the other PC?

Your situation seems to be pretty constrained and I am having a bit of difficulty understanding just how limited you are from your statement. Perhaps an echo server would work, it would receive local broadcasts and you can modify the packets including their address and then send them to as many clients as you wish. Here is an example: planetsourcecode.com/vb/scripts/

I don't think it is hard to understand. If you use ffmpeg to broad cast : "ffmpeg .... rtsp:1.2.3.4:1234", ffmpeg will make its own port listening, when someone connect to that port, ffmpeg will establish its own connection. That's failed because I can only use VB6 to listen to certain port and establish VB6's own connection when someone connect. So, the solution is to make ffmpeg broadcast to localhost, then VB6 MUST pretend/mimic that it is the real ffmpeg to the other PC somehow. But I don't know how to pretend/mimic!

ffmpeg - Solution for VB6 to broadcast Webcam - Stack Overflow

vb6 ffmpeg streaming webcam
Rectangle 27 24

You can use AVCaptureVideoDataOutput and a sampleBufferDelegate to capture raw compressed frames, then you just need to stream them over the network. AVFoundation provides an API to encode frames to local video files, but doesn't provide any for streaming to the network. Your best bet is to find a library that streams raw frames over the network. I'd start with ffmpeg; I believe libavformat supports RTSP, look at the ffserver code.

Note that you should configure AVCaptureVideoDataOutput to give you compressed frames, so you avoid having to compress raw video frames without the benefit of hardware encoding.

Both of these were good helpful answers. It was hard to decide. Thanks!

ios - What Techniques Are Best To Live Stream iPhone Video Camera Data...

iphone ios ios4 video-streaming avfoundation
Rectangle 27 0

Thanks for the info TinC0ils. After digging a little deeper I'v read that they have modified the Axis camera with custom firmware to limit the streaming to just a single 320x240 H264 feed, to better provide a consistent quality video over different networks and, as you point out, be less of a draw on the phone's hardware etc. My interest was driven by a desire to use my iphone to view live video and audio from a couple of IP cameras that I own without the jerkiness of MJPEG or the inherent latency that is involved with "http live streaming". I think Dropcam have done an excellent job with their hardware/software combo, I just don't need any new hardware at the moment.

Oh yeah, I almost forgot the reason of this post RTSP PROTOCOL DOES WORK ON THE IPHONE!

Streaming live H.264 video via RTSP to iphone does work! w/example - S...

iphone streaming ffmpeg rtsp
Rectangle 27 0

After some research it seems that Microsoft uses rtsp which is a variation of the rtp protocol. Fortunately ffmpeg supports muxing and demuxing in that format. https://www.ffmpeg.org/ffmpeg-protocols.html#rtsp . You may have to adjust the parameters outlined. If the server must be a vb6 frontend, you can have ffmpeg launched as the backend from the command line. This is a common method and I found an example of it here: https://www.ehow.com/how_6038708_use-ffmpeg-visual-basic-6.html for reference.

The next stage is the ability to play those streams in visual basic 6. What you can do is add a Windows Media Player control and set its property WindowsMediaPlayer1.URL to {a list with your url added to it as a string}. One version of control has a id of {6BF52A50-394A-11D3-B153-00C04F79FAA6} and the dll is wmp.dll. Make sure the control has autoStart & invokeURLs set to true.

Some other things worth mentioning is trying to use WMP compliant codecs and contains such as windows media video.

Thanks for taking time researching on this stuff. Your solution would be perfect except the fact that VB6 holds the connection. When FFMPEG broadcasts the live signal, it could only broadcast RTSP locally but VB6 is the one that transfer the signal over the internet to the other end. So, do you have any trick to make VB6 redirect a local rtsp protocol through internet to the other PC?

Your situation seems to be pretty constrained and I am having a bit of difficulty understanding just how limited you are from your statement. Perhaps an echo server would work, it would receive local broadcasts and you can modify the packets including their address and then send them to as many clients as you wish. Here is an example: planetsourcecode.com/vb/scripts/

I don't think it is hard to understand. If you use ffmpeg to broad cast : "ffmpeg .... rtsp:1.2.3.4:1234", ffmpeg will make its own port listening, when someone connect to that port, ffmpeg will establish its own connection. That's failed because I can only use VB6 to listen to certain port and establish VB6's own connection when someone connect. So, the solution is to make ffmpeg broadcast to localhost, then VB6 MUST pretend/mimic that it is the real ffmpeg to the other PC somehow. But I don't know how to pretend/mimic!

ffmpeg - Solution for VB6 to broadcast Webcam - Stack Overflow

vb6 ffmpeg streaming webcam
Rectangle 27 0

As of iOS8 access to the hardware backed encoder/decoder api is available. To get an overview of how this can be done watch the WWDC 2014 session on "Direct Access to Video Encoding and Decoding". In a nutshell you get the pixel buffers from the camera, feed them to the encoder and you get encoded blocks back that you can then feed on in turn to whatever library you are using for the network streaming. You might have to do some data conversion before you can just go and use it. As far as I remember ffmpeg does have rtsp support, so you should be able to use that after getting access to the encoded frames...

Video encoding in ios - Stack Overflow

ios video ffmpeg video-streaming live-streaming
Rectangle 27 0

First, what does the av_dump_format shows? Are you sure your video stream codec is h264, because you try to open the codec as if it were H264.

avcodec_find_decoder
codec = avcodec_find_decoder(formatContext->streams[videoStreamIndex]->codec->codec_id);

By the way, (forget this one if you do not use the c++ code but stick with c#): you do not need to make a copy of the initial AVCodecContext when you are looking for the video stream. You can do: (note that you may want to keep a pointer to the inital codec context, see below).

AVCodecContext* c = s->codec;
if (c->codec_type == AVMEDIA_TYPE_VIDEO) {
    videoStreamIndex = i;
    initialVideoCodecCtx = c;
}

Next point, not really relevant in this case: instead of looping through all the steams, FFmpeg has a helper function for it:

int videoStreamIndex = av_find_best_stream(formatContext, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);

Last point: I think only the first point should do the trick to make avcodec_open2 work, but you might not be able to decode your stream. You opened the codec for the new codec context, but no codec is opened for the inital context. Why did you make a copy of the initial codec context? It is usefull if you want to record your stream in another file (i.e. transcode), but if you only want to decode your stream, it is much easier to use the initial context, and use it instead of the new one as a parameter for avcodec_decode_video2.

avformat_find_stream_info
int videoStreamIndex = av_find_best_stream(formatContext, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
AVCodecContext* codecCtx = formatContext->streams[videoStreamIndex]->codec;
AVCodec* codec = avcodec_find_decoder(codecCtx->codec_id);
// tune codecCtx if you want special decoding options. See FFmpeg docs for a list of members
if (avcodec_open2(codecCtx, codec, null) < 0) {
    return;
}

// use av_read_frame(formatContext, ...) to read packets
// use avcodec_decode_video2(codecCtx, ...) to decode packets

Added av_dump_format output. Your version fails for following reason: codecCtx->codec_id is 0 (and thus avcodec_find_decoder returns NULL). Initially I thought this is why get_context_defaults call was necessary.

The problem was my fault, in the end. I used header without FF_API_CODEC_NAME defined (and AVCodecContext has 32 bytes field in the beginning of the struct if this macros is enabled). Once I defined it, I successfully got my pictures. Thanks for the help and sorry for wasted time.

Hi, @Abstraction, could you explain a bit more this last bit? Do I just define FF_API_CODEC_NAME before including libav?

@chuckleplant : yes and no. I had to re-write structs in C#, so I just added byte padding[32] in the beginning of AVCodecContext; when using original C++ headers, macro definition before including struct definition should do the same. But the main problem is that source code contains a number of ifdef branches, with no info which of them should be enabled, so for me it was basically trial-and-error solution. Thus, for other applications of the library other problems of the same kind may arise.

Then the problem might be somewhere else, for me the cause is not the C# usage, but the redefinition of some structs to solve this other topic. Thanks!

Reading RTSP stream with FFMpeg library - how to use avcodec_open2? - ...

ffmpeg rtsp
Rectangle 27 0

This error could be most likely caused by different encoding parameters for VLC and FFmpeg - VLC could use encoding parameters that Android is able support, but FFmpeg could use unsupported ones (most likely AVC profile and level). Try to force baseline or main profile and YUV 4:2:0 pixel format through the FFmpeg command line options and ffserver.config.

Stream low latency RTSP video to android with ffmpeg - Stack Overflow

android video ffmpeg stream rtsp
Rectangle 27 0

It seems at this time, the only way to do what I want is to create a static binary to use, from complete scratch. Libavcodec, FFMPEG, and Live555 are all under LGPL. Which means, in order to not make my code open source, I would have to allow dynamic linking, so that my app users have the ability to make modifications to the open source libraries I used, whenever they want. The AppStore does not allow dynamic linking, so I am essentially dead in the water unless I want to write it all from scratch. Which, I definitely do not want to do...

where do you guys keep getting all this false information, if you go to the ffmpeg site there are FAQ's on using on IOS, just about every IOS rtsp, rtmp app in the app store uses ffmpeg. that said I believe we try to update the mooncatventures libs as much as we can, we do a lot of commercial contracting and that has to take priority. The libs work with armv7, right now there is no compelling reason for armv7s, when you build the app just remove that from app settings and you will be fine.

yes , live555 has good streaming ability, but for decoding you still need to use ffmpeg or something similar, contact us if you want some help

@MichelleCannon What information are you saying is false? How are they getting it into the AppStore with it being under GPL/LGPL? I was under the impression that I had to use static linking in app to use, and without providing my source code, would not comply with licensing?

ffmpeg - RTSP/RTMP Video Streaming Client iOS - Stack Overflow

ios ffmpeg rtsp rtmp live555
Rectangle 27 0

RTSP is supposed to be supported on android but seems to be broken , I recently had to play rtsp streams and ended up writing my own player using ffmpeg. there are a couple good projects you might try. Dolphin is one .

Live Video Streaming on Android 3.0+ (HLS and RTSP/RTP) - Stack Overfl...

android video streaming rtsp http-live-streaming
Rectangle 27 0

I've had a similar problem with H264 and FFmpeg. My problem was that some devices are not sending the sequence (SPS) and picture parameter sets (PPS) with every frame, so I've needed to slightly modify my frame data.

iphone - FFmpeg does not decode h264 stream - Stack Overflow

iphone ffmpeg video-streaming h.264 rtsp
Rectangle 27 0

It has been quite q while, not sure what's the story back in 11, but yes, ffmpeg now support so.

Does FFMPEG support RTSP authentication? - Stack Overflow

ffmpeg rtsp rtsp-client
Rectangle 27 0

You should use ffmpeg library, as this library can connect any streaming server (supporting rtsp, mms, tcp, udp ,rtmp ...) and then draw pictures to the screen.. (for drawing you can use opengles or uiimage also works)

First of all, use avformat_open_input to connect to your ip address then use avcodec_find_decoder & avcodec_open2 to find codecs and to open them (you should call them for both audio & video)

Then, in a while loop read packets from server by using av_read_frame method When you get frame, if it is audio then sent it to AudioUnit or AudioQueue, if it is video, then convert it from yuv to rgb format by using sws_scale method and draw the picture to the screen.

You should not use ffmpeg since the license makes it very difficult to include the library statically linked into your iPhone app. Unless you are going to release the source code for your own app, then you should find another solution.

iphone - Video Streaming Libraries for iOS? - Stack Overflow

iphone objective-c ios video video-streaming
Rectangle 27 0

Just my two cents, but from the logical point of view a PLAY command for a multicast RTSP stream does not make any sense since the clients will get the media as soon as they join the group. The multicast stream as such does not have state.

Is the multicast RTP stream active at this point? Maybe VLC is actually joining the group after the SETUP response but no data is being transmitted to it? Also you can use VLC error log to see what is going on.

Here is an example RTSP session with a multicast stream between VLC and an IP camera:

DESCRIBE rtsp://192.168.3.142/stream/profile1=m RTSP/1.0
CSeq: 5
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Accept: application/sdp

RTSP/1.0 200 OK
CSeq: 5
Connection: Keep-alive
Date: Sat, 10 Jan 2015 16:54:28 GMT
Content-Type: application/sdp
Content-Length: 352

v=0
o=- 0 0 IN IP4 192.168.3.142
s=rtsp://192.168.3.142/stream/profile1
t=0 0
a=control:*
m=video 2014 RTP/AVP 99
a=rtpmap:99 H264/90000
a=fmtp:99 sprop-parameter-sets=Z0LgKdoB4Aiflm4CAgwE,aM48gA==;packetization-mode=1;profile-level-id=42e029
a=control:rtsp://192.168.3.142/stream/profile1/AVCESEnc
a=framerate:30.0
c=IN IP4 239.100.10.10/1

SETUP rtsp://192.168.3.142/stream/profile1/AVCESEnc RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Transport: RTP/AVP;multicast;client_port=2014-2015

RTSP/1.0 200 OK
CSeq: 6
Connection: Keep-alive
Date: Sat, 10 Jan 2015 16:54:28 GMT
Session: 241934337;timeout=60
Transport: RTP/AVP;multicast;destination=239.100.10.10;port=2014-2015;ttl=1

PLAY rtsp://192.168.3.142/stream/profile1=m RTSP/1.0
CSeq: 7
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Session: 241934337
Range: npt=0.000-

RTSP/1.0 200 OK
CSeq: 7
Connection: Keep-alive
Date: Sat, 10 Jan 2015 16:54:28 GMT
Session: 241934337
RTP-Info: url=rtsp://192.168.3.142/stream/profile1/AVCESEnc;seq=14604;rtptime=3766807430

GET_PARAMETER rtsp://192.168.3.142/stream/profile1=m RTSP/1.0
CSeq: 8
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Session: 241934337

RTSP/1.0 200 OK
CSeq: 8
Connection: Keep-alive
Date: Sat, 10 Jan 2015 16:54:29 GMT
Session: 241934337

TEARDOWN rtsp://192.168.3.142/stream/profile1=m RTSP/1.0
CSeq: 9
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Session: 241934337

RTSP/1.0 200 OK
CSeq: 9
Connection: Close
Date: Sat, 10 Jan 2015 16:54:31 GMT
Session: 241934337

As can be seen lower in the comments, Neverbirth pointed out that the issue was not in the SETUP command but in the HTTP headers for the DESCRIBE command - a wrong content length was used in the response. After fixing that the problem was solved.

Yes, the RTP stream is active at that point. It would make sense not to send a PLAY command, but according to the RTSP spec the PLAY command should be sent. Also, the VLC log hasn't proven too useful... unless there is another log aside from the log window.

@Neverbirth To give some more help I tried VLC against an IP camera with multicast to see what happens. VLC does send the play command, so I tried to see what could possibly be wrong with the SETUP response. The camera describes the transport as Transport: RTP/AVP;multicast;destination=239.100.10.10;port=2014-2015;ttl=1. Looking at the RFC it does not state that destination and ttl should be mandatory, but still all the examples use them. I'd say try adding destination and ttl and I don't think you need to set source to the multicast IP since the stream actually comes from your IP.

As I said in the original post I already tried it, but will again just in case. How did you see the command? Wireshark, some proxy or through some VLC log? could you post the full SETUP reply in bin format? maybe I'm missing some header...

@Neverbirth yeah sorry, I missed that. I captured the traffic with Wireshark, I can put the whole RTSP session here if that helps.

c# - Wrapping an existing RTP stream with RTSP - Stack Overflow

c# .net ffmpeg rtsp rtp
Rectangle 27 0

Android default player supports RTSP streaming. You can using it stream/play video from server.

Thanks, but I've encountered some transport problems via UDP on devices like MOTO's milestone and that flashed with the MIUI rom. So I want to implement a player myself.

android - Using ffmpeg to decode the video stream read from live555 - ...

android ffmpeg rtsp live555
Rectangle 27 0

When you meet such error You should try to force ffmpeg to use only TCP connection - I believe that when switching from UDP to TCP ffmpeg tried to pause stream what may not be supported by IPCam like Edimax IC 3030 .

Here is pice of code:

AVDictionary *opts = 0;
av_dict_set(&opts, "rtsp_transport", "tcp", 0);
avformat_open_input( &FormatContext, path.c_str(), NULL, &opts )

linux - FFMPEG error while receiving rtsp stream - Stack Overflow

linux ffmpeg rtsp
Rectangle 27 0

This error could be most likely caused by different encoding parameters for VLC and FFmpeg - VLC could use encoding parameters that Android is able support, but FFmpeg could use unsupported ones (most likely AVC profile and level). Try to force baseline or main profile and YUV 4:2:0 pixel format through the FFmpeg command line options and ffserver.config.

Stream low latency RTSP video to android with ffmpeg - Stack Overflow

android video ffmpeg stream rtsp
Rectangle 27 0

I'd take a look at FFmpeg. It's the most widely used opensource codec library and can be compiled for the iPhone. It has RTSP support (Microsoft deprecated MMS streams in 2003 and most current mms:// streams are actually just RTSP.

You don't actually need to port C/C++ libraries to Cocoa to be able to use them with Cocoa/Objective-C. You can use C libraries directly and C++ ones with Objective-C++ or using a C wrapper.

Or are you worrying about the license? Many parts of FFmpeg are LGPL and can be used from proprietary applications.

c++ - Are there open source audio stream clients or frameworks? - Stac...

c++ c objective-c audio
Rectangle 27 0

You can easily do it via Vitamio Lib. Vitamio can play 720p/1080p HD, mp4, mkv, m4v, mov, flv, avi, rmvb, rm, ts, tp and many other video formats in Android and iOS. Almost all popular streaming protocols are supported by Vitamio, including HLS (m3u8), MMS, RTSP, RTMP, and HTTP.

And a demo from here.

I am sending the live through link. It includes FFMPEG lib. Now, I integrated this VITAMIO lib in myproject but i am getting this errorlink

Please note that Vitamio's Standart Edition is limited for twelve months vitamio.org/en/License

video - Live stream RTMP/RTSP player without using webview (WOWZA serv...

android video ffmpeg rtsp wowza
Rectangle 27 0

They are using open source projects to receive the frames and decoding in software instead of using hardware decoders. This will work, however, this runs counter to Apple's requirement that you use their HTTP Streaming. It will also require greater CPU resources such that it doesn't decode video at the desired fps/resolution on older devices and/or decrease battery life compared to HTTP streaming.

Streaming live H.264 video via RTSP to iphone does work! w/example - S...

iphone streaming ffmpeg rtsp