This website uses cookies to enhance your browsing experience. By continuing to use this website, you agree to our use of cookies. Click here to learn more, including how you can manage your cookie preferences.

Back

RTMP VOD and Live Streaming Using Red5 and Kaltura CE 4

This post assumes you have Kaltura CE4 and Red5  installed and configured for webcam recording, if you don’t read this post.
In this final video post about Kaltura CE4 and Red5 integration, we will show how to enable RTMP delivery and live streaming.
[kaltura-widget uiconfid=”6420041″ entryid=”1_44q21xg6″ width=”551″ height=”330″ addpermission=”” editpermission=”” /]RTMP delivery and live streaming using Red5

 

Enable RTMP delivery

  1. Set the RTMP URL on kConfLocal.php
    vim /opt/kaltura/app/alpha/config/kConfLocal.php
    Change “rtmp_url” => “YourSite/oflaDemo” (line 17)
  2. Edit the playManifest to use red5 server for RTMP
    vim /opt/kaltura/app/alpha/apps/kaltura/modules/extwidget/actions/playManifestAction.class.php
  3. Mark line #524
    // $baseUrl = myPartnerUtils::getRtmpUrl($partnerId);
  4. Add the following instead:
    $baseUrl = “rtmp://YourSite/oflaDemo”;
    Mark lines (531 – 534)
  5. Add these code lines below the marked code:
    $key = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
    $fileSync = kFileSyncUtils::getLocalFileSyncForKey($key);
    if(!$fileSync)
    continue;
    $urlManager->setClipTo($this->clipTo);
    $urlManager->setFileExtension($flavorAsset->getFileExt());
    $urlManager->setProtocol(StorageProfile::PLAY_FORMAT_RTMP);
    $url = $urlManager->getFileSyncUrl($fileSync);
  6. Enable Red5 to follow soft links – fixes the “media not found issues”
    vim /usr/share/red5/conf/context.xml
  7. Add this inside the content object:
    <Context path=”/oflaDemo” allowLinking=”true”/>
  8. Restart red5 server
    service red5 restart
  9. Test RTMP
    Go into partner account -> preview and embed -> select RTMP and play the video

 

Enable Live Streaming

  1. Adjust Provisioning Code
    vim /opt/kaltura/app/batch/batches/Provision/Engines/KProvisionEngineAkamai.php
  2. Comment everything from
    $flashLiveStreamInfo = $this->streamClient->provisionFlash… (lines 56 – 88)
    Until the return line (not including the return line)
  3. Paste the following before the return line:
    $data->streamID = 'livestream';
    $data->backupStreamID = $data->streamID;
    $data->streamName = $job->entryId . '_%[email protected]' . $data->streamID;
    $data->rtmp = 'rtmp://YourSite/oflaDemo';
    $data->primaryBroadcastingUrl = 'rtmp://YourSite/oflaDemo';
    $data->secondaryBroadcastingUrl = 'rtmp://YourSite/oflaDemo';
    $data->encoderUsername = '';
  4. Change stream clipper
    vim /opt/kaltura/app/alpha/apps/kaltura/modules/extwidget/actions/streamclipperAction.class.php

    Change $streamer = “rtmp://YourSite/oflaDemo”; (line 24)

  5. Test live stream
    Create a new live stream (KMC->content->new live stream)
    Add the stream name into your streaming appliocation for example: Flash Media Live Encoder
  6. Create a page with embedded live stream player
  7. Use any encoder for example Adobe FME (Windows and Mac) – and broadcast your live stream.
  8. Connect to the live stream using the page you created at step 6

Let us know in the comments or email us about your Red5+Kaltura Live Streaming deployment.

Let's Get Going