New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTMP Support for video and audio #337
Comments
Try it with a source tag like this: This works for me using a Wowza 2 server. Good Luck! |
The current code cannot play a RTMP video file when the video file is in a subfolder on the server. For example, the URL rtmp://your.server.com/vod/subfolder/flv:subfolder/streamname.flv will not be played. But, rtmp://your.server.com/vod/subfolder/flv:streamname.flv will be played. |
I confirmed that it won't play if within a subfolder. The problem lies in all of the url manipulation not passing proper urls when creating the connection and playing in For example:
Both of these problems cause the video not to load, because first the connection isn't valid and even if it was, The url I used in the example is pretty common but very hard to parse what the streamer is as opposed to what the actual filepath is. If the I'd help out but I don't have Flash available :/ |
I am dealing with this problem as well and it may indeed be a showstopper for us. Basically we are streaming RTMP via FMS. We are dynamically generating MP4 videos on the server and storing them in dynamically generated sub directories of the FMS application instance. We are then dynamically generating the RTMP URLs of the proper format . . . rtmp://someserver/video/definst/mp4:/data/some_vid.mp4 We have two separate web applications each using different players. Our custom flash player plays back the RTMP URL above no problem. The Media Elements flash fallback player chokes on this URL. I can see the request in the FMS access logs and the application instance name is all wrong (it is "definst/mp4:/data"). This appears to corroborate the parsing problem that jeremyharris points out above. If I move the video to the "root" directory of the application instance, Media Elements plays it back fine, for example, rtmp://someserver/video/definst/mp4:some_vid.mp4 Anyone know if a fix has been release or if there is a known workaround? I really don't want to hack into VideoElement.as like Jeremy is suggesting. |
@cgrube I'm not sure the author knew that this was a problem based on other threads. I just discovered that this was the cause today, so we'll probably have to wait until John has some time to work on it. That is unless you want to fork and submit a PR which I'm sure @johndyer would love. The real question is how to implement a fix. If you added a
Then the AS class would use that key to create the connection, then strip it out when it goes to play. Something like this:
Another option would be to support a |
Sounds like a good change to me. It could definitely be an option and then the URL would be in the |
Sure do! The videos contain religious content. I'm not sure why I feel I have to note this, but we live in a sensitive world :) This one doesn't work with the current code: Excluding the Thanks for your help John! If you can't get to it by Monday I should have access to Flash by then and will be able to fork and PR. Are you thinking the |
Does this update solve your issue: #574 |
Hmm I can't tell just by looking because the diff is has so many whitespace/line ending changes. From the looks of it though he expects a file extension prefix (https://github.com/pansapien/mediaelement/commit/a4154854a780ae2dcc611816984c873206895f2b#L1R449) and also still assumes the file name is just everything following the last I'll apply it on Monday and check it out. If it doesn't work I'll fork and submit a patch sometime Monday. I'll have access to Flash by then so I'll be able to properly test. There's unfortunately no way to "parse" an RTMP url because it doesn't have to have the extension prefix ( |
Thanks John, Jeremy and pansapien, it looks like, at least in initial testing, the pull request does address my specific issue with MP4s in subdirs. I hope to do some additional and more thorough testing over the next couple of days and I will try to report back here when I am done. |
How about a url without the prefix, like: rtmp://s3etkigca2rtc6.cloudfront.net/cfx/st/huntingtonbeach/files/2012/09/20120909_huntingtonbeach_message.mp4 Both are acceptable AFAIK though the prefix is preferred. |
While people are digging in to RTMP support, I'm trying to connect to live streams (as opposed to archived files) and haven't had any luck. Has anyone else had success with these types of streams? All of the examples I've seen require the 'streamer' and 'file' flashvars to be set, and I haven't found a way to make MEJS add those correctly. Example traffic camera from Maryland's website: streamer: file: If you want to view this wrapped in a webpage: |
Okay, so I take back my previous comment. The prefix is indeed required except for flv files. I figure using FLVs with mediaelement.js is an edge case (could be wrong), so guessing the streamer based on the @johndyer I think #574 will work for everything except for non-prefixed flv files. Please merge when you have a moment :D |
We are having the same subfolder issue, but with audio. Using pansapien's patch mp4's work fine. I don't know a thing about flash, so does anyone know of any patches designed to get rtmp audio with subfolders to work? Or does pansapien's patch account for those and I have something screwed up on my end? |
@chrismjones Unfortunately @Pansapien's patch only applies to video. Some copying and pasting (or some class extending putting I wish I still owned a copy of Flash so that I could contribute. Le sigh. |
@jeremyharris I really just hacked a slight improvement onto the existing code to meet my immediate needs. I think you're right though, there needs to be a better structure to handle RTMP properly. If it makes sense to refactor this, one other useful feature would be to try to fallback from rtmp -> rtmpt (and rtmpe -> rtmpte) for good performance by default, but not breaking when the viewer isn't able to connect on the default RTMP port (e.g. the viewer is behind a corporate firewall). |
@Pansapien You seemed to indicate in the pull request that your change supports MP3 over RTMP. Is that right? I am not able to get that working at all (regardless of location of MP3) while progressive download of the same physical file works. (See my longer post at #574) |
@cgrube It does not, as per my comment before this one. |
@cgrube It doesn't currently work with MP3s. It's likely I overlooked something in the case of MP3s as I didn't have a need for them at the time. |
I have been reading this long discussion about RTMP w subfolder, as I was using video.js until then and I need to have RTMP support ... so at this point what is the current code to be used ? ( giving I download it to day and start using tomorrow) is it already modified or do I need to patch it ? thanks for feedback |
I've added a
or
|
thanks a lot ... got it |
Is there a reason the flashStreamer option is a data-attribute on the video element itself, as opposed to just on the source element that defines the video/rtmp option? |
I agree that makes more sense, but it would have required a lot more |
Awesome, thanks for the hard work John and everyone :D |
Hi @johndyer, I'm trying to have a rtmp streaming working. I have almost the same code you pointed out:
Whereas 'rtmp://thinkbuntu:1935/flvplayback' is the URL of a local rtmpserver and '000109f6004b00a6004af03676235daa' is a mp4 video. I know that the local server is working because using jwplayer I can play the video properly. Using flv, webm, ogv do not work neither. I get this error in Firefox (no error at all in Chrome): Configuring it via json attribute fails in the same way. I also tried this approach http://stackoverflow.com/questions/9113633/replacing-media-source-http-with-rtmp-in-mediaelementsjs-based-on-browser-capa but it fails too. Am I doing something wrong? |
From what I've tested the "flashStreamer" of "data-mejsoptions" is simply ignored. |
@johndyer Do you have an updated example of playing audio with rtmp flash streaming? I am not able to make it work in any way.... |
I also tried live rtmp streaming with mediaelement but not working any way.Getting this error message "Specified "type" attribute of "video/rtmp" is not supported. Load of media resource test failed". |
in my case I could easily connect to my rtmp server, and seek through the video, but only audio was being played.. weird. Had to give up with mediaelement |
I tryied to use your example for RTMP but i am unable to make it work for me. below is the code i was using:-
Please help me out to make it work if possible.if you have any example to work with RTMP with mediaelement the please share it with me.
thanks in advance.
Moin
The text was updated successfully, but these errors were encountered: