The ablilty to insert a url from an adobe streaming server (rtmp://example.com/myvideo.flv) would be a very nice (and needed) feature for a pro video site.

Comments

alex ua’s picture

Status: Active » Postponed (maintainer needs more info)

What video player supports rtmp?

perandre’s picture

@Alex UA: Use the module flvmediaplayer (jw player), and your cool. Flowplayer also works.

robloach’s picture

Status: Postponed (maintainer needs more info) » Active
Issue tags: +emfield, +Flowplayer, +rtmp

Flowplayer supports RTMP streaming. All we'd need to do is add the rtmp:// protocol to the compatible list of Custom URLs, and Flowplayer would be used to stream the RTMP video.

aaron’s picture

wow, nice! let's do that, then :D anyone have an example url i can use to test? i can work on this later this week.

adVid’s picture

@aaron : you can use 'rtmp://video1.advid.tv/druptest' as 'netConnectionUrl' and 'Extremists.flv' and 'mp4:Extremists.m4v' as filenames.
Don't forget to add rtmp plugin to flowplayer config. Do you think it could be a good idea to add a specific provider for RTMP streams ?

Thank you.

robloach’s picture

You can find an example of RTMP streaming through Flowplayer here:
http://flowplayer.org/plugins/streaming/rtmp.html

I'm not entirely 100% sure, but I think the latest version of Flowplayer supports automatic initialization of the RTMP when it sees the rtmp:// protocal. So you might be able to just use:

$output = theme('flowplayer', 'rtmp://cyzy7r959.rtmphost.com/flowplayer');
adVid’s picture

Rob, I don't think it would work. As I said before, you need to set 'netConnectionUrl' to the streaming server application root. Then set 'url' parameter to desired filename to stream.
From your link :
netConnectionUrl : The RTMP URL used to connect to the server app. Required if not specified in the plugin.
url : The name of the stream. For h.264 encoded files, use following format: mp4:stream.mp4. For audio files use mp3:audio.mp3. NOTE: With Adobe's Flash Communication Server the stream name does not include the file extension, for example mp3:audio, or mystream.

Actually, I already tried sth like 'rtmp://video1.advid.tv/druptest/Extremists.flv' but it does not work with current modules.

I'd really like to have some kind of 'rtmp-flowplayer' provider ;)

robloach’s picture

Ah, that makes sense. So it might end up looking more like:

$output = theme('flowplayer', array(
  'clip' => array(
    'provider' => 'rtmp',
  ),
  'plugins' => array(
    'rtmp' => array(
      'netConnectionUrl' => 'rtmp://flowplayer.org:1935/fastplay',
    ),
  ),
));

... In one of the 3.1.3 changelogs though, it read:

- Now automatically uses a plugin that is called 'rtmp' for all clips that have the rtmp-protocol in their URLs.

Not sure if that means it switches the URL to the netConnectionUrl or not. Worth a try :-) .

adVid’s picture

It fails here. Don't know how to make this work. No idea about URL may look like in this case :(

robloach’s picture

Check this out.....

$output .= theme('flowplayer', array(
  'clip' => array(
    'provider' => 'rtmp',
    'url' => 'Extremists',
  ),
  'plugins' => array(
    'rtmp' => array(
      'url' => 'flowplayer.rtmp.swf',
      'netConnectionUrl' => 'rtmp://video1.advid.tv/druptest',
    ),
  ),
));

Not sure how this would translate from Embedded Media Field Custom URL though..... rtmp://video1.advid.tv/druptest/Extremists.flv?

adVid’s picture

I think your code is right Rob. Also, URL schema 'rtmp://HOST/APPLICATION/' is always correct so your Custom URL could be easily interpreted by emfield.
Once again, another way to achieve this could be with a new provider. aaron ?

gp.mazzola’s picture

Hi I am trying to make flowplayer module to work with rtmp and I stepped into this thread.
I put the latest versions of flowplayer and rtmp plugin in the module folder and after trying various things I found out that:

the code

    'rtmp' => array(
      'url' => 'flowplayer.rtmp.swf'
    )

does not work for me. It does not find the plugin.
Then I have tried to give the complete URL like:

'url' => 'http://mydomain/sites/all/modules/flowplayer/flowplayer/flowplayer.rtmp.swf'

And still does not find the plugin.

Then I moved the plugin outside the modules directory and inside /sites/all/library/floplayer and gave the complete URL:

'url' => 'http://mydomain/sites/all/library/flowplayer/flowplayer.rtmp.swf'

This way it works. I don't understand why it is not able to load the plugin if it is inside the module directory.

dellis’s picture

Was there ever a solution to this? I'm hoping that the Embedded Video Field will recognize rtmp:// as well...

aaron’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Active » Needs review

I just committed an experimental test to DRUPAL-6--2 if someone can test that and let me know if it works, please...

aaron’s picture

should have done it w/ a patch, i know... sorry about that...

aaron’s picture

so i'm having the same problem as at #12. seems like the flowplayer should have a way to keep track of its own plugins? also, when i move flowplayer to libraries/ the error message disappears, but still no stream. maybe my approach of basename($url) and dirname($url) isn't correct? would appreciate another look over.

aaron’s picture

Status: Needs review » Needs work
robloach’s picture

aiwata55’s picture

StatusFileSize
new11.39 KB

Thanks to the update Aaron made yesterday (Feb 4), now FlowPlayer recognizes its rtmp plugin. I can see it in the activity window of Safari which shows all files loaded.

However, zzz_custom_url.inc missed a parameter for clip, so I added it. The missing parameter was "provider" inside "clip" (refer to the example code on http://flowplayer.org/plugins/streaming/rtmp.html). I set it as "rtmp" since it is a generic provider I thought. I attached my version of zzz_custom_url.inc, so please take a look at it. My amendment is on line 125 and 126. Note that you remove the file extension ".txt" before you save it to the emfield directory.

I also want to tell that current version of Emfield may have a problem with "url" parameter handling.

  • It seems that Emfield now looks at the file extension, and if there is none, it regards the url as an invalid url. However, according to http://flowplayer.org/plugins/streaming/rtmp.html, there can be files without a extension.

    NOTE: With Adobe's Flash Communication Server the stream name does not include the file extension, for example: mp3:audio, or mystream.

  • if there is "mp4:" before the filename in the url, Emfield regards the url as an invalid url. But I think there are some cases "mp4:" is necessary. For an example, see the code for Multiple servers on http://flowplayer.org/plugins/streaming/rtmp.html .
    There is a similar one, "mp3", but I have not tested with it. However I suppose Emfield makes the same mistake.
  • There seems to be a case that the url parameter in "clip" not only has the file name but also has some directories. Currently Emfield detects the value for the url parameter in "clip" with basename(), but this may not work all the time. For an example of the url parameter with a directory path, see the code for Example on http://flowplayer.org/plugins/streaming/rtmp.html .
    (It may be better to provide two fields, one for netConnectionUrl and another for clip url, rather than Emfield accept only one field value and divides the url into two. Any thought?)

After all, my combo of Drupal + Emfield + Flowplayer + CDN still doesn't work. It shows a inline player box, but there is no player button when I move my mouse pointer over the player.

robloach’s picture

Thanks for helping debug, aiwata. Could you try to get it working with straight HTML and JavaScript so we can find out if it would actually work at all? If we find out what parameters are needed, then we could push them into emfield.

function theme_emvideo_zzz_custom_url_embedded_video($type, $url, $width, $height, $autoplay = FALSE, $field = NULL, $item = NULL, $options = array()) {
  if (count($parts = explode('rtmp://', $url)) == 2) {
    if (module_exists('flowplayer')) {
      $config = array(
        'clip' => array(
          'autoPlay' => $autoplay,
          'url' => basename($url),
          // Akishige Iwata added the following.
          'provider' => 'rtmp'
        ),
        'plugins' => array(
          'rtmp' => array(
            'url' => url(drupal_get_path('module', 'flowplayer') .'/flowplayer/flowplayer.rtmp.swf', array('absolute' => TRUE)),
            'netConnectionUrl' => dirname($url),
          ),
        ),
      );
      $attributes = array(
        'style' => "width:{$width}px;height:{$height}px;",
      );
      return theme('flowplayer', $config, 'emvideo-zzz-custom-url-embedded-video', $attributes);
    }
  }
aiwata55’s picture

Status: Needs work » Needs review

Rob Loach suggested to change the url parameter under rtmp plugin, and now Emfield plays streamed videos. I paste just the part of zzz_custom_url.inc. The change is to add base_path() before drupal_get_path(). Please take a look at the code.

function theme_emvideo_zzz_custom_url_embedded_video($type, $url, $width, $height, $autoplay = FALSE, $field = NULL, $item = NULL, $options = array()) {
  if (count($parts = explode('rtmp://', $url)) == 2) {
    if (module_exists('flowplayer')) {
      $config = array(
        'clip' => array(
          'autoPlay' => $autoplay,
          'url' => basename($url),
          'provider' => 'rtmp'
        ),
        'plugins' => array(
          'rtmp' => array(
            'url' => url(base_path() . drupal_get_path('module', 'flowplayer') . '/flowplayer/flowplayer.rtmp.swf', array('absolute' => TRUE)),
            'netConnectionUrl' => dirname($url),
          ),
        ),
      );
      $attributes = array(
        'style' => "width:{$width}px;height:{$height}px;",
      );
      return theme('flowplayer', $config, 'emvideo-zzz-custom-url-embedded-video', $attributes);
    }
  }
...

Although Emfield on my site now plays streamed videos, Emfield still has some problems with handling the source url, I think.

aaron’s picture

that makes no sense! url() called with absolute should automatically prepend base_path(). but i'll commit this anyway, since it shouldn't harm things.

aaron’s picture

that's in there; please let me know if it works so we can mark this issue fixed.

thanks,
aaron

aiwata55’s picture

Success report.

I updated Emfield to 6.x-2.x-dev (2010-Feb-19), and set the source url as "http://e1p2.simplecdn.net/flowplayer/eye-pseudo.mp4". The player worked.

aaron’s picture

Status: Needs review » Fixed

excellent! thanks; marking this fixed then.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

thehong’s picture

Status: Closed (fixed) » Needs work

zzz_custom_url.inc > wrong rtmp url render:

url(base_path() . drupal_get_path('module', 'flowplayer') . '/flowplayer/flowplayer.rtmp.swf', array('absolute' => TRUE))

It should be:

url(drupal_get_path('module', 'flowplayer') . '/flowplayer/flowplayer.rtmp.swf', array('absolute' => TRUE))
robloach’s picture

Status: Needs work » Needs review
StatusFileSize
new914 bytes

url() does take a $path relative from the Drupal base path.

dfqwar’s picture

Hi, i'm newbe on drupal world, i was reading a lots content in this site about how to use red5 and flowplayer3, also i try with jw mediaplayer 4, but i don't know why no work for me, i have a block with swf content like this [swf file="sample.flv" stream="rtmp://192.168.1.2/oflaDemo/" params="width=630&&height=324"] but don't work , when i test with red5 sample its work, :( somebody can help me??

RasputinJones’s picture

Haha. I got bit by the base path bug this morning and fixed it independently. Please commit this soon. Spent 6 hours figuring out the problem.

robloach’s picture

Status: Needs review » Reviewed & tested by the community

So, set the issue to RTBC? :-)

aaron’s picture

Status: Reviewed & tested by the community » Fixed

committed, thanks @Rob Loach & @thehong!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

emilianoq’s picture

Hello Everyone,

i have a script that is supposed to stream video and make it available to chat users

I have installed red5 as required by the script.
Now i have to alter a script:
< Pref Data = "rtmp://some_flash_hosting_site/www_some_site_com" />
My red5 is installed under this pass in the root server : /usr/src/red5/webapps

I am not sure on how to place that link : rtmp://some_flash_hosting_site/www_some_site_com

Any help is appreciated.
Thank you in advance.