Merge two Media Sources together - c#

I have run to a brick wall in this particular situation where I have to merge two MediaSources together, one for video and one for audio, and then play that in MediaPlayerElement.
I have searched google a lot but haven't found anything relating to it. The actual problem is that I get two Urls and I can create two MediaSources from them but I cant put those two sources in the player source, because when i do it either plays the video or the audio depending upon which was the last source.
So I basically created two MediaPlayerElements and assigned different sources to them and try to sync the audio and video between them but sometimes it creates awful results. I have also thought about creating two streams and then combining those two to create a single stream but I dont know anything about streams so I am not able to do that yet.
Any suggestions here? Maybe a 3rd party library which works in UWP and can help me here? Thanks

What you are trying, adding players and trying to sync is a duct tape solution :), could work, but you will probably have issues.
As you did not mention I'm assuming you need to support various formats for audio/video, which if you go with your current solution you will need to test every possible combination to be sure it works.
The proper way to merge audio and video is to merge the streams, a great (and free) tool you can use for this is FFMPEG, you can use a wrapper for the command line that works with UWP found here, it also has a NuGet package. It supports a lot of formats and is very fast as it's written in C.

Related

is it possible to manipulate the DOM of a web build and add some contents inside the game?

I'm working for a newly formed Unity team in my company and we came across a problem where we have to put certain questions on a quiz game. The problem is, the questions are already being used on multiple projects and is shared with HTML contents, like the Latex. They also uses Mathjax, a library used to write mathematical formulas. Some of this terms are supported by TextMesh, but not all of them.
I'm attaching few questions below.
Choose the digit(s) that can fill in the blank of a four-digit number $\underline{~}531$ to make it divisible by $9.$
There are wallpapers of two different sizes, $6\text{ feet}^2$ and $8\text{ feet}^2.$ What should be the minimum area of the wall, which can be fully covered using some identical wallpapers of any of given type?
We discussed this problem internally and came up with different solutions.
add dummy text in the field and change the DOM of the final build, but this needs an id and we don't know if this option is available in unity.
render the whole questions into PNGs and then put this PNGs instead of text. Is this possible?
Use TexDraw from Unity store which we are not sure if all the things are supported.
How do I go with this problem?
is there anything else that can be done?

GraphEditPlus VideoInputDevices are missing

I am completly new with DirectShow and filters. I was reading some articles, tried some examples with C# and I've used libraries like AForge or DirectShow.NET. I've excluded AForge from my project because of huge latency and bad performance in my project. I've found good example where DirectShow.NET was used and after some refactoring performance of the code was fair enought so I want to try with that.
I couldn't make ISambleGrabber to work so now I'm trying to use GraphEditPlus, connect the graph and generate C# code as example for future use, but...
I cannot find VideoInputDevices filter there, I need to start Previewing and Capturing from webcam, but I cannot find it on the list. It is shown on VLC and is working with AForge and DirectShow.NET.
Mayebe I'm blind or I'm missing something? Any hints?
Yup, I'm blind - it's named here as Video Capture Sources which I haven't seen before.

SilverLight: How to record a video from a web camera

I have searched how to use SILVERLIGHT to record video for days but got no luck.
Most articles related to SL only talk about how to record audio or snap a picture rather than recording a video file and save it somewhere.
And I found there is no resources about it on Internet(I am surprised!!!)!
So could you provide me an example code with proper explanation?
I am waiting for it.
PS: I do not want to use Flesh as none iPhone nor iPAD supports it.
Thanks
Fortunately, Mike Taulty's source code can easily be updated to work with Silverlight 5. You can download the fixed source code and try it out (Disclaimer: all code courtesy to Mike Taulty, I merely fixed SL5 compatability and ran a cleanup). Use your favorite diff tool to see the changes I made.
I have tested it, and it generates video files that can be viewed in VLC media player (after selecting build index to fix the corrupted index). As the file format is not 100% correct, the files can not be opened in Windows Media Player etc... but I'm sure that can be fixed.
You should, however, be aware of the fact that Silverlight is not supported on iPhone, iPad, Android, and Windows Phone (Windows Phone apps are made on a special version of Silverlight, but can not run Silverlight applications in the browser).
Unfortunately, after undergoing hundreds of hours researching on the possible solution, I finally found the answer in a book called: Pro Silverlight 4 in C# (Matthew MacDonale, APress).
According what is said on the page 436, although you can do it with Silverlight 4 (you have to write your own file header helper, store the row data as byte arrays and later on you have to convert them into a raw video data and what is worse is the audio and video are separated.), it is just not practical and worthy to do it. Because it requires reams of complex, handwritten code to convert it, and the conversion process is computationally expensive, which makes it extremely difficult to do in real time.
So I guess this would be the conclusion of my question. Now what seems still make sense for me is to find out why Microsoft doesn't support it and what is the new technology which is going to be used/ has been used to replace the SL.
Is it HTML5? But as far as I know, there is only a video tag in HTML which can only be used as a video player, but no tag to support to get the access of a web camera and save the captured video+audio at the same time as one file onto somewhere which could be a local hard drive or a network storage.
I hope all dear you could come up with some thoughtful advice.
I am going to leave this question un-answered for a few days to see whether there could be someone who can come up with some fantastic solution.
Thanks again.

How do you read the properties of a file in C#?

I am currently working on two programs and both are still in the planning phase but I have one question that I need to answer before I finish planning. Is there anyway to pull a file in and read the properties?
Basically what I want to do is be able to read the properties of image files and pull out the resolution, file size, date taken, and all that. And then do the same with music files (artist, album, length, so on). The closest I've found is a 6 year old project to pull the EXIF information out of images at http://www.codeproject.com/KB/graphics/exifextractor.aspx .
I'd be thrilled if there is one method to pull properties out of both kinds of file types. But I'll also be happy with two separate ways.
Including the one you found, there's also a good one hosted on Google Code named ExifLibrary.
Edit: Found another one here based on Drew Noakes Java MetaData Extractor.
Are you looking for a .NET way to access media metadata properties?

Streaming audio file to another computer

This is what I am trying to do. We are 5 people in a room. Everybody has a PC. Each PC has mp3 files but only one of the PCs has speakers (ex. called Speakers-PC). So, instead of asking the person on Speakers-PC to play you a song you want, I was thinking of an application that can take an audio file from a No-Speakers-PC and send it to the Speakers-PC. The Speakers-PC can then play the audio file. Of course, if multiple files are sent, the application on Speakers-PC will have a queue.
So, is it worth digging or it will be just better if we buy wireless speakers and rotate the transmitter (instead we are now rotating the speakers) :)
Any ideas on how to implement something like this? I am familiar mostly with .NET technologies.
Any broad or specific help would be greatly appreciated.
Best Regards,
Kiril
Many media players come with web interfaces already. One of the winamp ones, for example, is http://www.winamp.com/plugins/details/92511
VLC is the swiss army knife of media streaming, take a peek at the extensive feature set :)
I quick thought.
I assume the "speakers-PC" use winamp. If so then create some playlist file and load it with winamp. Also everyone of you should share your folders containing mp3 files so that "speakers-PC" could have access to them. From this point you have two options:
1. Everyone who wants to add his own song to a playlist opens it in any text editor and adds a new line at the bottom of the file.
2. You could create a simple web app to manage this same playlist file. You know .NET, rignt?
I haven't checked if winamp locks playlist file it currently plays. If it does then this idea is not worth a penny.
Here is basic structure of playlis file discussed.
http://forums.winamp.com/showthread.php?threadid=65772
I'm sure you can find in google
Good luck

Categories