How to show video from byte array? - silverlight-4.0

I am working with Silverlight. I have created MemoryStreamVideoSink which is inherited from VideoSink.
In method OnSample(long sampleTime, long frameDuration, byte[] sampleData)
So my task is to show video from byte byte[] sampleData. Is it possible?

You should check if the format of your video supported from Silverlight or not.
And taks a look at this SO question please.

Related

IMFTransform covert camera stream color format, IMFTransform::ProcessOutput returns freeze image data

I'm very new to Windows Media Foundation API. I try to create a program that can display and manipulate camera video input stream.
I'm using Media Foundation for video stream reading, the supportted color format is NV12, so I had to convert it to RGB or ARGB to create Opengl texture object.
I tried to do it using pure c++ code on CPU side, but the perfomance is very bad. Then I tried to use IMFTranform to do color convertion, the performance is very good, but I got a strange problem.
IMFTransform::Process returns S_OK, but I keep getting freezed image output. The result image pixel are not updated in realtime, keeps getting freezed for many frames, and the freezing time is getting longer and longger. If I use pure c++ code the do the color convertion, then everything works fine.
Here are my code, https://gist.github.com/zhiqiang-li/16d1a6a1b00e8fb39847c8ca323b5604. Please let me konw what do you think I'm doing wrong.
Did you try to let the SourceReader do the conversion for you :
hr = mAttributes->SetUINT32(MF_READWRITE_DISABLE_CONVERTERS, FALSE);
By default, the source reader and sink writer can perform some format conversions on uncompressed audio and video streams. To disable this behavior, set this attribute to TRUE when you create the source reader or sink writer.
By default it is FALSE, so you don't really need to explicitly set this attribute.
Then :
hr = mSourceReader->SetCurrentMediaType((DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM, NULL, mediaType);
with :
mOutputMediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_NV12);
Also calculate image size according to NV12 format (MF_MT_FRAME_SIZE). Don't set MF_MT_DEFAULT_STRIDE, the SourceReader will do it for you.
So the idea is to get NV12 format from the SourceReader, even if the capture source gives RGB32 format. The SourceReader is normally able to do this.

Register a sound already loaded as a base64 or binary in soundjs library

I have a big problem, I have not found a solution yet for.
In short I have a front end web page where a custom API build on the fly audio tracks.
All the tracks are temporarily stored in a variable within the browser as base64 strings. My problem is that i would like to register these sounds in createjs to manage them easily.
How could I register sounds in soundjs by using audio base64 content rather than a path, that doesn't exists because the page is state less.
As a simple example:
var audioTrack = "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU2LjQwLjEwMQAAAAAAAAAAAAAA//NgxAAfA83wAGGGFQMIZ+nd3dkIiIiIzngML/5p6Fp7uHfDmh6fXc//93pzcyp+7J9eu7u/8Sv/TeIAIgQQoAiIEACc+IEAABPQnNPpxCfwgASFuYQAJ0RCd/hoXhwN30RETd7EsAEQkrmVc9zifxD/4lcIIr/Q4snd/w4tE0TSi2HEQ8M47Uc8QMnWzM1LYrvfe+W0lbPfEU/z//NixBMde+oQwUsYASV5WyDOxGghUzruf/rMlZazLs/lKl+MXuX3KIyP9dXM86qWi8fq+LocfLzN6XtViezOJtPBym5sivjSYjQrSBmTYgfTprtetHM7/KR/wiTDkflYvf6pxfDwOSAxd3GRUMEYYrNunqHpoGE//fV/Sf/Pdil+oqk+YeqWDT39NRmOxCr15TNyuYFTu7drKkoHwP/zYsQtJxwOOAGZgAE7AsUEZiDwFe9Tde1O6ChqCwC5BwGYjwonyf9T6L0q/uzu6CibPi5ysVHLhoQwiBfHaIXZH3tv1qrfrSdl+SYg8YwcAggSxPlUi58g5fQHeXEen6r6l1/RdB3e+9X8nFFxJE3ImcYqHVG6k3JgnHj1tdtEous2kydBqNIqFZEZoFY/Uto2nNjlf/v6QaflAsP/82LEICYDvsJfj0ADAbg2Bd62WeIZ4OpLDTbFBHhh4e8MUNTSnNiDjmPJEoKQFgbf3CHzQqWUIiCMIbCo5ZaWMIMrfubWXpN6bt2ZTiaFU/+vfrT+PrIp1zhY4V1Q3jZ4ma0eu/qK+bR3PSt77//9eK//+P//d3RO+9DOnM8FP0IMzfHbv+/++cILKjYnt7E0mUmUFpMt/ZzTbUML//NgxBgkK5LeX8lAAL7/Q09OuE/mBREqnftKfinGf/8UHY9Irvh4p3BoDQ21EBBSuOZP/6+DNJSX5hEpEm0jTubiYS8zIksYtoIg+FmBeDHFyw/pYDzgVc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1odCqJI8u7f61SwoIcxkd9nR7vf//7kd76Uu1wrLMrAOtpgXLESxGJg6ssWBr/JCYkBlluSDKpy5CY1WrVtDkxPWAFAOP4cQPkJEPUllKPkNSWFWvdVyyESpIkVImkzgGp4IWkTXpYVCpFGvGOfCJmOdYLAkKn/yx4OgISlQaBr/P/zYsRMHIkeZAxj0og0VBU7W4SvDX+dPAqEpENBWeEScRToiPFbrh8RWBr/JKPAqAivDSoIspXnTUbq5H91z9gIl1GdkDHlCNpmzSSCE7p9GrwaRFpMTHuhMKnp6GT4WGXo0jtfaUhNNC03kkf3IMWX2OyoZUnDfQg0pG5jhjU/qbnPD6ogsyEJpo8skME04eMFhiF6kInUqQY8mQP/82LEaR3LxgwAWMYJy52Yc7pisxt7JQVbZoJVEQaRImpLNSRC5QusIQoK5GsVVUoalVVRKqQYT6k2vhQEjgYCb4fqsVVql/w71fvGAjvdS9m4VI6q0qpKq//+pQ4za/wozMdCgLdXpf+1CqqhQEBEl9UKAqpfsXMozNGP9gIV//+xrqqgICxUNAUFQalpboVMQU1FMy45OS41VVVV//NixIEc4630AEhGVFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ=="
createjs.Sound.registerSound([src], "audioTrack"); // HOW CAN I USE THIS FUNCTION TO REGISTER MY STRIN
createjs.Sound.play("audioTrack"); // AND THEN PLAY IT
Instead of putting in a variable you can create an audio element, like this:
var snd = new Audio("data:audio/wav;base64," + base64string);
snd.play();
Use de HTMLAudioPlugin Class
Here have more info, if you have problem with new Audio()
play .wav sound file encoded in base64 with javascript

Stream to File in WinRT

How i can save a Stream to File in WinRT. Currently i am working on a Open Source library for creating PDF file in windows 8. I build the stream with pdf content, now my requirement is to save this stream to file. Can anyone please guide me to solve this issue.
I assume you're working with C#? One way to do it would be to read the stream content using DataReader and store it into a byte[] buffer. After that you can create the file like this:
var file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync("filename", Windows.Storage.CreationCollisionOption.ReplaceExisting);
await Windows.Storage.FileIO.WriteBytesAsync(file, buffer);
Then again, if you already have to byte data for the pdf, you can skip making it a stream in the first place.
Hope this helped.

FMDB, How to manually release string created from stringForColumn

I'm working with the FMDB, The SQLite Wrapper for iOS.
General Problem:
I'm reading a long string (Base64 encoded image) from the db and then sending it to a UIWebView to be displayed. The when I pop the view controller storing that webview (with the image) the program quits unexpectadly with:
([Controller respondsToSelector:] sent to deallocated instance...btw, I am not calling that method)
The error only cropped up when I started using the large strings.. It never happened before that which leads me to believe it may be something to do with memory and the string not being released in Objective-c after it is sent to the webview.
Possible Solution
I would like to know how I can take control of the string returned from FMDB's "stringForColumn" method. The way I see it is that I can't ever call release on the resultant string as i'm not creating it.
I'm pretty sure I need to dump that string from memory straight after it is sent to the webview (via stringByEvaluatingJavaScriptFromString)
Any ideas greatly appreciated as this is a real show stopper for me :(
Thanks!
if you need for some reason to keep in memory that string, you should call
yourString = [[db stringForColumn:#"foo"]retain];
since then, you are responsible for that string, and you should release when you're done with it.

Prevent webcam light from illuminating when accessing microphone in Silverlight 4

I'm writing a small audio recorder component in Silverlight 4. It works fine, but I've noticed that when I'm recording audio, the light on my webcam turns on indicating that the camera is active.
While I know that I'm not doing anything insidious with the webcam, my users would have every right to be suspicious. Is it possible to tell Silverlight that I'm only interested in microphone access and not activate the webcam?
FWIW here's how I'm accessing the mic:
private CaptureSource _source = new CaptureSource();
private MemoryAudioSink _sink; // Inherits from AudioSink. Doesn't do much more
// than store PCM audio stream in memory
private void Record_Click(object sender, RoutedEventArgs e)
{
if (( CaptureDeviceConfiguration.AllowedDeviceAccess ||
CaptureDeviceConfiguration.RequestDeviceAccess() ) &&
_source.State == CaptureState.Stopped)
{
_sink = new MemoryAudioSink();
_sink.CaptureSource = _source;
_source.Start();
}
}
CaptureSource will frequently grab the default video input device, even if you don't tell it to. Though you aren't using the camera, Silverlight is indeed accessing it. Hopefully, MS will fix this odd behavior in a later version of Silverlight.
In the meantime, just explicitly set VideoCaptureDevice to null:
var _audioCaptureSource = new CaptureSource {VideoCaptureDevice = null};
This would depend on the webcam driver - Silverlight would have no control over this.
I'm guessing its related to your use of CaptureSource. Microsoft's web site claims that:
Silverlight 4 APIs only use
CaptureSource in a video scenario
where audio may not be relevant.
Is there a way to get audio without creating your own CaptureSource?