Page 1 of 1

video streaming

PostPosted: Sun May 23, 2010 5:11 am
by mobilpress
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.

Re: video streaming

PostPosted: Mon May 24, 2010 9:11 pm
by kamermans
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.

Re: video streaming

PostPosted: Sat May 29, 2010 2:23 am
by mobilpress
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

Re: video streaming

PostPosted: Sun May 30, 2010 2:12 pm
by kamermans
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;
?>