Resolving rtmp stream url from Adobe Flash container - ffmpeg

How can a rtmp stream url be retrieved completely with its playpath and be played with ffplay/avconv from a flash plugin. In embedded flash code below rtmp address exits (rtmp://live.atv.com.tr/atv) , however it does not work with avplay since it needs playpath.
<param value="config={"key":"##c67bf4e753034f78950","play":{"display":"none"},"clip":{"eventCategory":"Canli Yayin","url":"atv3","live":true,"provider":"influxis"},"plugins":{"controls":{"url":"http://i.tmgrup.com.tr/p/flowplayer.controls.swf"},"influxis":{"url":"http://i.tmgrup.com.tr/p/flowplayer.rtmp.swf","netConnectionUrl":"rtmp://live.atv.com.tr/atv"},"ova":{"url":"http://i.tmgrup.com.tr/p/ova.swf","autoPlay":true,"overlays":{"regions":[{"id":"Reklam","verticalAlign":"bottom","horizontalAlign":"right","backgroundC...0,"style":".smalltext { font-style: italic; font-size:10; }"}]},"ads":{"notice":{"show":true,"region":"my-ad-notice","message":"<p class=\"smalltext\" align=\"right\"> Kalan süre : _countdown_ saniye.</p>"},"schedule":[{"zone":"5","position":"pre-roll","server":{"type":"direct","apiAddress":"http%3a%2f%2fad.reklamport.com%2frpgetad.ashx%3ftt%3dt_atv_canli_yayin_preroll_800x700%26vast%3d2"}}]}}},"playerId":"live","playlist":[{"eventCategory":"Canli Yayin","url":"atv3","live":true,"provider":"influxis"}]}" name="flashvars">
Problem Solved: Using wireshark (network analyzer) is much more effective to retrieve paramaters like rtmp url, playpath...
Edit2: Some urls are also embedded in scripts files rather than directly in flash object, this variables are used in flash object above, later.

Related

How do I extract and record audio in webRTC on Firefox?

I implemented one to one webRTC video chat (Both audio and video)
navigator.getUserMedia({
audio: true,
video:true
}, function (stream) {
}, function(err){
})
But i want to record only audio of the chat session. In chrome i am able to record by using RecordRTC, But in Firefox i am getting video+audio file (webM).
How do I extract audio in Firefox from audio+video stream?
you have one of two ways to do it, when you make new recording, you do new RecordRTC(stream, config):
currently the stream you are passing must be videostream, you can change it to audiostream as stream.getAudioTracks()[0], I have not tried this, but guessing that it should work.
or as part of config, add an attribute recorderType: window.StereoRecorder, now it would use StereoRecorder and not firefox's own MediaStreamRecorder.
p.s: have you tried recording remote stream in chrome, because chrome supports recording only stereo mode and webrtc provides audio in mono mode.

Can not play local rtsp URL using FFmpeg in iOS

I am using FFmpeg for stream rtsp URL in iOS.
I am trying to stream a local url but my app is failed to open url
avformat_open_input method always return -5
I have played the same url rtsp://172.16.1.226:5544/1 on VLC media player on my iPhone and macbook it works on both.
After few research i have found there is some problem with rtsp_transport
I was using av_dict_set(&serverOpt, "rtsp_transport", "tcp", 0); for the server configuration while opening url and the result is can not open feed.
When I changed it to av_dict_set(&serverOpt, "rtsp_transport", "udp", 1);
I am able to open url successfully but I continuously getting error rtsp 1 missing packet and so on.
Can anybody help what should be the right configuration while opening a local rtsp url using ffmpeg.
Should i need to update av_dict_set(&serverOpt, "rtsp_transport", "udp", 1)
Thanks in advance
Yes you can use UDP means av_dict_set(&serverOpt, "rtsp_transport", "udp", 0) in your code it will work.
You can also skip this step. I am playing local and remote both RTSP URL and setting nothing.
Direct open the URL using avformat_open_input without specify the rtsp_transport.

Streaming MP3 audio to HTML5 audio tag from servlet

I'm having some cross-browser compatibility joys. I have a Ruby WEBrick server with a couple of servlets, one of which is used to stream media (Ogg and MP3). The servlet gets a couple of query parameters (a base64 urlsafe string key, a small string user, and a small number, sid). When I put the URL verbatim into Chrome, I get the QuickTime extension, and it works. When I post the same into FireFox, I get the expected unsupported codec. When I put it in Safari, it works. However, the URL is not being accessed directly. I have a jQuery Mobile app that uses the Javascript Buzz library, and uses these servlet streaming URLs as sources. The code works in Safari, allowing me to play the sounds. On FireFox, instead of falling back onto Ogg, it gives unsupported errors, and on Chrome, it does nothing. Here's the code that serves the MP3:
res.status = 200
str = File.new("Music/#{req.query['sid']}.mp3", 'r:BINARY:BINARY').read
res.body = str
res['content-type'] = 'audio/mpeg'
Can anyone tell me how to get audio streaming to all browsers through a Ruby servlet?
Note: This is not a duplicate. I've been thorough a lot of SO answers, but none work because they are designed for static files, not servlets.

Is a .mp4 video file recorded in the WP Emulator ready for outside storage?

MS have released some code examples where a video is recorded in the WP Emulator and then saved in isolated storage. Is this .mp4 file ready to export away from the WP Emulator and play in other applications? Or is it needed to format it in some way or the other? If so, how to do it?
http://channel9.msdn.com/Shows/Inside+Windows+Phone/Inside-Windows-Phone-16-Mango-Camera-APIs
Source code for video recording is located in the WP project is called CameraUpload:
https://skydrive.live.com/?cid=bc58fec5c97e307a&sc=documents&id=BC58FEC5C97E307A%21295
http://msdn.microsoft.com/en-us/library/hh394041(v=vs.92).aspx
Edit:
I am trying to upload a video recorded in the WP Emulator to Azure blob.
A file does get uploaded, but I am not able to play that file in Zune.
I would like to be able to play the video file recorded in the WP Emulator on Zune, what to do to enable this?
The method in the Azure WCF service role, which saves the video looks like this:
(Please forgive if the method parameters have slightly misdirecting and confusing names.)
bool SaveImage(int salesItemId, string contentType, byte[] photo);
The video is saved to a blob container named "firstmay".
The code in the phone client saving the video looks like this:
client.SaveImageAsync(77, "mp4", GetPhotoBytes(m_capturedFileName));
public byte[] GetPhotoBytes(string fileName)
{
using (var appStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
IsolatedStorageFileStream isoStream = appStorage.OpenFile(m_capturedFileName, FileMode.Open);
byte[] buffer = new byte[isoStream.Length];
isoStream.Read(buffer, 0, (int)isoStream.Length); isoStream.Close();
return buffer;
}
}
When uploading a video from the WP client application, one first records a video and then uploads it by clicing "Save", it all goes on in the MainPage.
The client and server application can be downloaded from skydrive:
https://skydrive.live.com/redir?resid=159250F5CE7FE134!118
That'll all depend on what you want to be able to play back the content on. PCs with Zune would be fine, and I'd expect other video capable mobiles to be fine, but older mobiles, or standard Vista installs would require additional software, or transcoding of the video to be playable.

MediaPlayerLauncher with HTTPS

I would like to open an audio file from an HTTPS resource.
First, I tried using MediaPlayerLauncher like so:
MediaPlayerLauncher mediaPlayerLauncher = new MediaPlayerLauncher {
Media = filename,
Controls = MediaPlaybackControls.Pause,
Orientation = MediaPlayerOrientation.Portrait,
Location = MediaLocationType.None
};
mediaPlayerLauncher.Show();
filename in this case is a URL beginning with https://.
Using Fiddler to monitor traffic, I have noticed that https:// in filename is getting changed to http://.
Next I tried opening the same URL using WebBrowserTask:
WebBrowserTask webBrowser = new WebBrowserTask {
Uri = filename
};
webBrowser.Show();
Checking Fiddler out again, I noticed that two requests are being sent. First is a request to filename by the browser. This results in the "Tap to open file" message to appear in the browser. Tapping it opens the phone's media player (MediaPlayerLauncher?), which sends another request -- in this case, the https:// changed to http:// again (which is similar result to first attempt).
The server I am getting the file from only supports HTTPS, hence the problems arising when the media player requests the file as HTTP.
Is there anyway to stream a file from an HTTPS resource? Does Windows Phone's media player even support it?
Pointing location on the internet for the MediaLuncher is a bad idea. It will freez UI thread and your app won't be responsive. Try first download the audio as a stream and then play it. Use WebClient to open a stream. HTTPS can be open in WP7, so that shouldn't be a problem.

Resources