convertion of .mp4 file to .3gp in windowsphone 8 using c#.net - windows-phone-8

Using capturesource I got the video in isolated storage, But I need to upload that video to server,
whenever I try to send the video, The size is huge so I need to compress(convert) the video from MP4 to 3GP
The default message screen of windows phone shows "processing video" whenever I send a video message through attachment,and it convert .mp4 video to .3gp.
I tried a lot of research to achieve the conversion from MP4 to 3GP please help me
The code is
CaptureSource captureSource = new CaptureSource();
private string isoVideoFileName = "CameraMovie.mp4";
private FileSink fileSink;
VideoCaptureDevice webcam = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
AudioCaptureDevice audio = CaptureDeviceConfiguration.GetDefaultAudioCaptureDevice();
captureSource.VideoCaptureDevice = webcam;
captureSource.AudioCaptureDevice = audio;
fileSink = new FileSink();
fileSink.CaptureSource = captureSource;
fileSink.IsolatedStorageFileName = isoVideoFileName;
captureSource.Start();
I tried to change the resolution of VideoCaptureDevice but it not helped me.

If it's possible for you, you can upgrade your app to Windows Phone 8.1 Silverlight (you'll need to download Update 2 for Visual Studio 2013 and put the developer preview on your developer device(s)). The conversion itself is straightforward - I had no issues with a very complex WP 8.0 app (although backup your app first!)
Once that's done you can then access the Windows.Media.Capture.MediaCapture library. This will allow you to change to more resolutions than are available using VideoCaptureDevice. For example you can create a profile that will record video to QVGA like this:
MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Qvga);
Which will give you a resolution of 320 x 240 and a file size of ~20MB for 4 mins of video. Still not ideal from my purposes either, but a big improvement. MediaEncodingProfile also has methods like MediaEncodingProfile.CreateWmv() and MediaEncodingProfile.CreateAvi() but I've not been able to get these to work yet (see my question here: MediaEncodingProfile.CreateWmv gives "No suitable transform was found to encode or decode the content." error).
The tutorial I used to get video recording using MediaCapture can be found here: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn642092.aspx
Hope this helps...

Currently there is no public API that allows you to convert from MP4 to 3GP.
One option would be to port FFmpeg to Windows Phone but currently, if anyone has done it, its not publicly available.

Related

How do you change source in a web audio context

I'm making a game that changes some of it's object depending on what music is playing. After each song has ended I want my audio context to load in a new source and analyze that. However whenever I tried to do that I've gotten the error that an audio object or buffer can't be called twice.
After some researching I learned that ctx.createMediaElementSource(MyHTML5AudioEl) lets you create a sourceNode that takes the source from a HTML5 object. With this I was able to loop through different song.
However for my game I need to play/analyze a 30 seconds "remote url" that comes out of the Spotify API. I might be wrong but ctx.createMediaElementSource(MyHTML5AudioEl)does not allow you to analyze a source that is on a remote site.
Also the game needs to work on Mobile Chrome, which createMediaElementSource(MyHTML5AudioEl) does not seem to work on.
I might be on the completely wrong path here but my main question is:
How can I switch remote songs urls in web audio api. With it being compatible with mobile chrome.
Thanks!
First, as you found out, you can't set the buffer again for an AudioBufferSource. The solution is to create a new one. AudioBufferSources are intended to be light-weight objects that you can easily create and use.
Second, in Chrome 42 and newer, createMediaElementSource requires appropriate CORS access so you have to make sure the remote url sends the appropriate headers and you set the crossOrigin attribute appropriately.
Finally, Mobile Chrome currently does not pass the data from an audio element through createMediaElementSource.

Playing online radio using BackgroundAudioPlayer on Windows Phone 8

I want to play songs from a online radio and for that i am using the BackgroundAudioPlayer for windows phone 8. Now i downloaded the sample app provided by MS and modified that a bit primarily to test whether the streaming link is working or not. So, my new AudioTrack object is looked like this one,
new AudioTrack(new Uri("http://live.abcradiobd.fm:8282/;listen.mp3", UriKind.Absolute),
"ABC Radio",
string.Empty,
string.Empty,
null)
This is not working at all. After sometimes it generates TimeOutException but the link is perfectly working in VLC player and other audio player out there.Any solution?
Solved:
Tried Phonesm and it's working perfectly. You can use that for both audio and video streaming. But before building that project make sure that you have downloaded the correct version for MPPF which is v1.2 from here and install as an extension to visual studio.

How to record audio and save at local system using htlml5?

My basic requirement is let user to record his voice and wish to save that recorded audio at my local system. We do not wish to use flash player as we are planning to run at mobile also, our web application should run at desktop browsers, mobiles as well as at iPad?
I tried running sample suggested by at - http://webaudiodemos.appspot.com/AudioRecorder/index.html
Windows 7 Firefox 26.0 - Not working
Windows 7 Chrome Version 31.0.1650.63 m - Working
iPad Safari - Not working
I need some solution that works fine on any browser at Windows, mobiles and as well as at iPad?
How can record audio and save them at local file system without flash player?
Thanks
If you want to capture audio in browser you need to use navigator.getUserMedia function.
As you can see from your example it uses in initAudio function(main.js file):
if (!navigator.getUserMedia)
navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
More info about getUserMedia you can get from article on html5rocks.com. And as you can see getUserMedia works only in FF and Chrome.
What about to save any to local file system. Any browser don't give you permission to write something to filesystem, it's unclassified, but they have it implementation in sandbox by using requestFileSystem. More info about requestFileSystem you can get from html5rocks.com
If you want to create modern HTML5 app - check often sites like html5rocks.com for new articles and read that already published.

Streaming Icecast through flash

Hi my name is Tamer and this is very first post in stackoverflow as far as I know. :)
I've been searching this for an issue of mine for a while but haven't found any solutions yet. I want to forward my radio broadcast from it's original host to my embedded flash player once the play button is hit. Is it possible via action script (flash - as3) ? My broadcast is in Icecast format, and I'm playing mp3 but my mount point is not exactly /listen.mp3. It has some more extention like ?auth and some random fixed stuff (I mean, there are some other things at the end of the auth part, but it's same all the time like a fixed link).
Thanks for your help and time!
Yes, you can play your stream with Flash. It doesn't matter what your mount point is. Just plug in the real URL for the stream. The file name extension and what not doesn't matter.
When using the above answer high memnory use may be an issue for your viewers as the "Sound" variable downloads the data while playing.
Would be better off using progressive play/download but would have to change your streaming format from mp3 as it only allows for M4A streaming (AAC audio data in an MP4 container).
var netConnection:NetConnection = new NetConnection();
netConnection.connect(null);
var netStream:NetStream = new NetStream(netConnection);
netStream.play(“http://your.stream.url/stream.m4a”);
Just my 2cents :)

Capturing Microphone Using Html 5 and broadcast using socket.io

I am currently developing Virtual Classroom with whiteboard,video/audio conferencing. How can I capture microphone using HTML5,Javascript. How can i create base64 encoded string from microphone ? I already capture video image from tag and draw on canvas and received base64 encoded string and broadcast to all students and its works. is any similar way for audio tag also ? i would like to broadcast teacher microphone voice to whole class using socket.io. I found number of tutorial but every body explain about video not audio :( . I am using Chrome -v 21 and able to use webkit.
Thanks in advance
The Stream API should allow you to do this but unfortunately it's not supported in any of the current (stable) browsers. You could download the nightly build of Google Chrome which definitely includes some support for the API, though how complete I'm not sure.
I'm guessing it shouldn't be too long until plugins for node start appearing to help with the handling of this stuff on the server side, but meantime the following might be useful:
Streaming audio from a Node.js server to HTML5 tag
A Node.js module for parsing and/or injecting metadata into SHOUTcast/Icecast radio streams.
Streaming audio using Firefox Audio Data API + Node.js + WebSocket + Redis Pub/Sub
Update:
http://code.google.com/p/chromium/issues/detail?id=112367
This issue is being worked making it stable for windows platform too, but working on Mac.