video streaming

Integrating Tera-WURFL in your applications.

video streaming

Postby mobilpress » Sun May 23, 2010 5:11 am

Hi,

I'm using Tera-Wurfl and it very good software.
Can you help me with this one:
I need to make detection of the phones for mobile video streaming.
For example some phones use h.263 codec.
Some of them: MPEG-4
And newest: h.264.

How to read suitable codec for video streaming (audio also) when we use Tera-Wurfl?

Thanks.
mobilpress
 
Posts: 2
Joined: Sun May 23, 2010 5:05 am

Re: video streaming

Postby kamermans » Mon May 24, 2010 9:11 pm

In order to detect the correct video codec to use, you need to check if the user's device supports one of the formats that you have encoded the video in. Let's assume you have all of your videos encoded in MP4 (H.264/AAC) and WMV (Version 7+). You could use the following code to display the supported streaming video format:
Code: Select all
<?php
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
if($wurflObj->capabilities['streaming']['streaming_video']){
   if($wurflObj->capabilities['streaming']['streaming_mp4']){
      echo "file.mp4";
   }elseif($wurflObj->capabilities['streaming']['streaming_wmv'] >= 7){
      echo "file.wmv";
   }
}else{
   echo "Streaming video is not supported";
}
?>


A complete list of the available capabilities is available here.
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX

Re: video streaming

Postby mobilpress » Sat May 29, 2010 2:23 am

Thank you Steve,

But I'm trying to understand this one:
We have mobile TV transcoding middleware and we have 3 types of output streams: h.263, MPEG4 and h.264.
Format:
rtsp://server.com/live_h.263.sdp
rtsp://server.com/live_MPEG4.sdp
rtsp://server.com/live_h.264.sdp

How to detect automatically which stream we will offer to users using Tera-Wurfl?

Thanks
mobilpress
 
Posts: 2
Joined: Sun May 23, 2010 5:05 am

Re: video streaming

Postby kamermans » Sun May 30, 2010 2:12 pm

Code: Select all
<?php
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
$link_href = null;
if($wurflObj->capabilities['streaming']['streaming_video']){
   if($wurflObj->capabilities['streaming']['streaming_vcodec_h264_bp']){
      $link_href = "rtsp://server.com/live_h.264.sdp";
   }elseif($wurflObj->capabilities['streaming']['streaming_vcodec_mpeg4_sp'] >= 0){
      $link_href = "rtsp://server.com/live_MPEG4.sdp";
   }elseif($wurflObj->capabilities['streaming']['streaming_vcodec_mpeg4_asp'] >= 0){
      $link_href = "rtsp://server.com/live_MPEG4.sdp";
   }elseif($wurflObj->capabilities['streaming']['streaming_vcodec_h263_0'] >= 0){
      $link_href = "rtsp://server.com/live_h.263.sdp";
   }elseif($wurflObj->capabilities['streaming']['streaming_vcodec_h263_3'] >= 0){
      $link_href = "rtsp://server.com/live_h.263.sdp";
   }
}
if(is_null($link_href)){
   $link = "Streaming video is not supported on your device";
}else{
   $link = sprintf('<a href="%s">Watch Video</a>',$link_href);
}
echo $link;
?>
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX


Return to Using Tera-WURFL

Who is online

Users browsing this forum: No registered users and 4 guests