Any way possible to get DTS audio output with MediaElement? - c#

Ok, the title tells what I need. I just wonder that is there any way to get DTS-audio output in mp4 (mkv) video files using MediaElement? It's looks like that Microsoft doesn't want to support DTS (still...yet...forever) so I'm trying to find other solution to solve this problem. For example some code project / lib or any other way that my app can convert / get audio track to ac3 , or any other solution? Oh, and wishing that solution works with Universal Windows Apps.

Related

Get MP3 File Duration in Windows Phone 8 C#

How can I get media element source (mp3 file) duration in windows phone 8 without playing the file.
Thanks,
There are at least 2 ways of doing this I can think of at the moment, however I´d recommend you to do it in this way:
first is to read it directly from file's MusicProperties by using GetMusicPropertiesAsync():
You might need to adapt the code a little bit, tell me if there´s something else you do need.

How to convert video files to H.264 in C#

I've searched without any luck about how this can be done in C#. What i'm trying to archieve is a program that accepts video files and converts them to H.264. Here is an example of a page where you can do this interactively:
http://www.ofoct.com/video-converter/convert-to-h-264-video.html
Question:
How can I in .NET create a program that can do something similar to whats being done from that homepage I shared? Any help or input is highly appreciated, thanks!
EDIT:
The reason i want to do this is because it seems like videos play in both iOS and Android devices when this is done, perhapps there is another way to make sure videos can play in both iOS and Android?
EDIT again:
Lets say i film a Video on a phone Android/iOS, now I'm using a ASP.NET web api that I'd like to convert theese movies to H.264 before storing in Azure, Is this possible? If so, any pointers on how?
There is a wrapper available http://www.ffmpeg-csharp.com/
The main point is that no one is going to write an encoder due to how slow it would be in .NET
Encoding/decoding are provided by the OS, through Direct Show (in the past) or Microsoft Media Foundation. For example, the Microsoft Media Foundation already contains a [H.264 Video Encoder](H.264 Video Encoder).
The SDK is appropriate for C++ and Microsoft hasn't released a wrapper. There are wrapper projects available though, eg. MF.Net, DirectShow.NET, WindowsMedia.NET although it doesn't have any activity since 2012.
There are also similar questions in StackOverflow, that propose other options, like using Microsoft's Encoder, although H.264 support is available only in the Pro version
The only plausable way would be to call out to an encoding application such as ffmpeg.
I'm not sure that this what you need but you can download a nuget called
NR.VideoConverter :> then you can write this code to convert the type of video
like from mp4 to mvo or anything I'm not sure what is h264 but I did find it when I wanted to change my videos so it could help y
var converter = new NReco.VideoConverter.FFMpegConverter();
converter.ConvertMedia(FilePath, FilePath, NReco.VideoConverter.Format.h264);

How to convert an wav file to mp3 file in windows phone?(Details Inside)

I've searched for 2 days and I'm not getting how to convert the recorded wav file to an mp3 file; seen many questions even on stack overflow itself but no one gave the solution.
We can't execute System.Diagnostics.Process in Windows Phone.
there are many encoders like Lame, NAudio and so on; but don't know how to use that. .
recently I found example in codeproject named "mp3 Compressor", I tried use those classes but now i'm getting the below error,
Somebody please tell me how to achieve it. .
Why are you trying to do that?
I'm afraid you can't and mustn't do that. at least with tools like those ones you mention. Note, for example, that Zune transform a media before transfering it to the devices.
As an idea, you could upload your file to a service online and make the conversion there. It's more difficult of course and providing you have a host you can use.

calculate playing time of a .mp3 file

I'm doing a sample which will run mp3 files which are selected by the user. I
want to calculate the playing time of the file (e.g. 00:05:32). How can I calculate the playing time?
You could use TagLib Sharp
It exposes TagLib.AudioProperties.Duration
For Alvas.Audio library see code below
using (Mp3Reader mr = new Mp3Reader(File.OpenRead("len.mp3")))
{
int durationMS = mr.GetDurationInMS();
TimeSpan durationTS = TimeSpan.FromMilliseconds(durationMS);
}
You suggest in the tag that you're doing this in C#. This question deals with it:
Finding MP3 length in C#
And there's some code for reading the MP3 header and extracting relevant information (like the length) here:
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=79
I believe the Windows Media API (or windows mixer api or something, I can't recall the exact name) has a way to open and read sound files like mp3 and maybe get the time from it too. As an added bonus, by using that API you can open any audio format that will work in say Windows Media Player, so you're not limited to just mp3's.

How can I create a thumbnail from an mpg video with C#?

I'd like to process a directory of mpg's in a batch to have a thumbnail using C#/.NET.
Does anyone have any good suggestions on how I could do this?
I know it's not C# .NET but ffmpeg is a great tool to do exactly this. Can be run as a command line tool from any language.
Here's a small tutorial to get you started.
I did this a few years ago, but I seem to have lost the source. Anyway, the route-of-least-resistance I found was to use DirectShow, there is an interop wrapper for managed code, namely directshow.net. You'll want to use IMediaDet's GetBitmapBits from the Windows Media Format SDK.
There is an example on CodeProject: Extract Frames from Video Files

Categories

Resources