How to use Hardware MFT for encoding audio from PCM to AMR in windows phone 8.1? - windows-phone-8.1

i need to encode my audio PCM raw stream to AMR. but i didn't find anything much regarding that.i need to know is it possible to use Hardware MFT for encoding and decoding the Audio stream. if yes then how it is possible some idea please.
or any other way to encode Audio Stream from PCM raw to AMR codec?

I posted this question in Microsoft forum and i got the answer, the answer is Microsoft doesn't support in-build AMR codec, to support AMR codec in windows phone we need to use Third Party Codec Library.
The response was:
Unfortunately it doesn't appear that we supply an AMR encoder in box. Because of this you will need to find a 3rd party encoder or use the in box low latency mp4 codec that we do provide.
and then also:
Let me try and clarify. We have limited AMR, 3GP and h.263 support for Windows Phone Silverlight apps. Encoding support for these codecs is not exposed in Runtime apps since we do not provide a default encoding profile implementation. These codecs should only be exposed in Silverlight. There doesn't appear to be a runtime activateable class associated with these codecs so there is no reflection into Media Foundation.

Related

Transcoding Audio/Video/Image file in Android Device

I am working on a chat application like whatsApp, I want to transcode media file before uploading to server,I have gone through so many links but not able to decide which method i should use, is there any straight forward way of transcoding in android ?
FFMPEG i found it is highly cpu intensive process ,it will consume more battery power
Media Codec i want to do the transcoding using mediacodec but not able to get proper steps to understand the process.
Best link to give idea about transcoding
Library to transcode using media codec (It has many bugs)
We used both implementation for our video editing app. Basically we used MediaCodec implementation if android version >= 4.3 and use FFMPEG otherwise.
The problem with using FFMPEG:
As you said, cpu intensive process thus consume more battery
x264 encoder is licensed under GPL, so you might want to use OpenH264 encoder instead which only support Baseline Profile, therefore video quality is not the best
Since it used software encoder, processing speed is relatively slow, at least compared to the MediaCodec implementation
MediaCodec also have some cons though, for example:
If you want to do transcoding, android version need to be >= 4.3 unless you want to deal with color format conversion yourself, which is completely mess, since each vendor may have it's own color format implementation. (Since 4.3, MediaCodec support encoding using input surface)
Hardware encoder may behave differently for different models. (For example some encoder may produces B frames which is not supported yet by android MediaMuxer, so you may want to use ffmpeg for the muxing part)
So I should say if you only support new android version, you should use mediacodec, but if you want to be safe (easier to write code that works on all device) and does not really mind the performance, use FFMPEG with OpenH264
Android's MediaCodec is a relatively better way to transcode on the client since it uses its own low level buffer processing. But then it doesn't provide elaborate tweaking freedom as FFMpeg does.
As to MediaCodec source code, it also is CPU intensive for holding the buffers and processing them but its actually way lesser than FFmpeg.

HTML5 <video> tag: RTMP streaming without Flash?

I am building a video-site for long lecture recordings. So a streaming server is a must. We only have to support newest browsers, which support the HTML5 <video> tag. So when the stream is done via RTMP protocol (Red5 server for example), will clients have to have adobe flash installed or is a browser capable of the <video> tag enough?
I think that for a simple video streaming service (for VOD) you are not forced to use a streaming server (like AMS, Wowza, Red5, ...) just a HTTP server (like Apache, nginx, ...) with a good configuration and some special modules (like nginx ngx_http_mp4_module, H264 Streaming Module for Apache, ...) can do the job because it can provide a HTTP stream available for Flash Player and HTML5.
So for your question, you should know that to play an RTMP stream on a browser, you should have Flash Player, HTML5 can not play it. That's why you have to provide a HTTP stream for HTML5 based video player. After that, you can use a Flash to HTML5 fallback or the inverse.
Hope that can help.
In case anyone else ends up here looking for a non-Flash solution for a non-http-based protocol i.e. RTSP (beware that OP asks for RTMP) here's a solution https://github.com/Streamedian/html5_rtsp_player.

Display RTSP stream in Adobe AIR

I am working on a project that involves displaying video feed from an IP camera using Adobe AIR. I know that Flash does not have a native support of RTSP protocol and therefore I am evaluating all possible routes I can take to solve this issue:
Use Adobe Media Server to convert incoming RTSP stream to RTMP and then use Flash API (NetConnection & NetStream) directly.
Write a custom class to fetch, decode and display the stream in adobe AIR. [I am unable to confirm if this is possible due to insufficient info on the net]
Give up on RTSP and instead fetch JPEG/MJPEG sequence of images and display them in AIR relatively easily but with doubtful live performance. [due to JPEG/MJPEG refresh interval of IP camera and same interval separately in AIR]
Use DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras to process the JPEG/MJPEG stream, create a virtual Webcam device (the filter does this automatically) and then use Camera class to display the video feed in AIR.
Use webcam 7 - A software designed to handle RTSP, JPEG/MJPEG and other stream protocols for many camera brands/models. It installs a driver in system that creates a virtual camera, and that all the other applications can then use as a normal webcam.
Unfortunately this software is buggy and often becomes unstable (could be with my particular camera model only though) and might even crash.
Are there any better, easier options that might not require any third-party software?
EDIT:
In case anybody else bumps into same problem:
As suggested by Rudolfs Bundulis, I decided to write a NativeProcess (ANE) that uses FFMPEG to fetch the RTSP stream data, transcode it, and feed it to Flash player.
You might want to look at these for more specific steps:
http://www.purplesquirrels.com.au/2013/02/converting-video-with-ffmpeg-and-adobe-air/
https://www.youtube.com/watch?v=6N7eN9wvAGQ
Take the route described in option 2 - write a Adobe AIR native extension (ANE) that uses FFMpeg to handle the RTSP stream, decode it and pass the RGB data back to AIR for rendering. The hardest part would be compiling FFmpeg if you need cross platform functionality, however, since you mention DirectShow that is Windows only, then I assume you are bound to Windows. Zeranoe provides prebuild FFmpeg libraries for Windows, Stackoverflow has a lot of topics on decoding a stream using FFmpeg and then all you need is a callback to AIR and you're good.

WebRTC to render H.264 video streams

I am developing a web application where I need to integrate H.264 UDP Streams. I am currently using HTML5. I want to know if I can do the same using WebRTC before I proceed.
WebRTC has lots of code related to h.264 decoding and rendering (i.e. here is WebRTC calling Mac APIs).
However, WebRTC is a monolithic piece of code, in that the networking and decoding are tied together. I don't believe you can build your own networking component, and then give the h.264 stream to WebRTC to decode and render.

H264 decoder source code

I am looking for h264 decoder C/C++ source code with RTP packetization support.
My embedded device is sending 640x480 encoded h264 RTP packet. I would like to make a Windows XP/Vista based video streaming display.
Where can I find the source code to this?
You should take a look at the h.264 reference implementation. RTP packetization is supported, and there are both an encoder and a decoder.
Videolan contains an implementation of h264 encoder (sorry - It uses ffmpeg to play back h264)
It's under the GPL and is a clean room implementation from the specs. Depending on your country there might also be patents on the decoder.