Which one is better choice for UWP? VLC is really easy to start to use but FFmpeg more complicated (read: difficult). But if we are thinking for example licenses, support of different format, casting, media tags, converting , subtitles and audio support, video/audio editing etc.
Any experiences?
Vlc.DotNet does not run with UWP.
I'd advise you to use https://github.com/kakone/VLC.MediaElement which uses a C++/CX wrapper under the hood to call libvlc. That's a rather complete sample app: https://code.videolan.org/videolan/vlc-winrt
licenses, support of different format, casting, media tags, converting , subtitles and audio support, video/audio editing
That's a lot of considerations and I don't know your requirements and needs. You should evaluate both. But for ease of use, VLC.MediaElement is the best choice.
Vlc Dot net . you can find details here https://github.com/ZeBobo5/Vlc.DotNet
This library will provide you better control. There are many other choices but as you are talking about audio/video/subtitles/formats you will find everything in this library. This is core medial lib and wrap by custom control.
Thus can be easily import in any wpf project/ Uwp project.
Related
I need to implement some sort of library that allows me to pick (one or multiple), edit, crop, resize, move and apply other effects on user's photos that will be sent to a server later.
I tried to write my own code to do so but it takes much more time and it's quite difficult.
Do you know some libs (open-source or not) that give me the chance to do so?
For editing I know:
Media plugin https://github.com/jamesmontemagno/MediaPlugin
UCrop: https://github.com/NAXAM/ucrop-android-binding
You can bind any library from native to xamarin
Just use SkiaSharp, its free has tons of documentation and is cross-platfrom
I recently came across libcinder which seems to be promising for creative coding.
It's for c++ but I'm more familiar with c#. Is there a way to use libcinder with c#?
Or maybe in c# world, there is some other collection of libraries / framework for the same purpose?
The first thing I'd like to try is to open an image then draw lines/rectangles on it, the second thing in my list is to open a live video and then draw some thing on the video. Is it the best choice to use cinder or should I just use OpenCV with c++/c#?
What libcinder feature are you looking for in "C# World". Many of the features listed on that link are already available in C# (.NET) since 2005-2008.
Example things that C#/.NET can do (same as libcinder):
Standalone Apps
Internet I/O
Platform Specific API's (PInvoke)
Xml & JSON Parsers
Full I/O Stuff
UI Events
Multi Touch
Communication API's
3D & 2D Graphics
Multimedia
My goal is to mix 2 audio files that is one voice and one background music. For mixing I am using NAudio.
The problem is I am getting following exception while reading mp3 file using NAudio's Mp3FileReader.
DllImport cannot be used on user-defined methods
I am using NAudio in Windows Phone 8.1 Silverlight app project. I am not sure if NAudio is useable on WP Silverlight app if its useable then please help by providing a code example or suggest any other library or custom implementation to mix 2 audio files.
No, I'm afraid NAudio is not usable on Silverlight, as it makes lots of calls into Windows APIs which you can't do in Silverlight. You can take a look at the NAudio NLayer project which offers fully managed MP3 decoding. You could use that in conjunction with some of the more generic helper classes in NAudio like the MixingSampleProvider to perform the mixing you require. Of course the next issue would be what you want to do with that mixed audio. Silverlight does have a way of streaming user generated audio using the MediaElement but NAudio does not provide support for this directly.
[DllImport] requires a substantial chunk of code in the CLR, nothing very subtle about the pinvoke marshaller. That's a problem on a phone, it runs a special version of the CLR named .NETCore. Probably better known today as the codebase that spun-off the CoreCLR open source project. Keeping it small required unsubtle choices, pinvoke fell on the floor.
So no, you'll have no use at all for NAudio. You'll have to dip into the built-in support for audio. The relevant oversight MSDN page is this one. This blog post is relevant.
As you can tell, XAudio2 is your ticket with direct support for mixing. There is a learning curve of course, the language is probably the first obstacle given the question tags. Get started with this sample to get the basics.
Maybe you should consider taking the step to upgrade from WP8.1 Silverlight (WPS) project to WP8.1 (WinRT) one so that you have better access to audio APIs...
...or directly to a UWP/Win10 app (if you don't plan to release immediately to phones). If you choose that path, you could try maybe a free preview tool that converts WPS to UWP, just released from Microsoft and Mobilize.NET - https://blogs.windows.com/buildingapps/2015/09/17/initial-preview-of-silverlight-bridge-to-uwp/
I have done some looking and I can't figure out a good way to write a 2D tile/sprite based game in C# for Win8. According to the MSDN documentation:
You can use managed code languages like C# and Visual Basic to develop 2D (and lightweight 3D) games.
The problem is that I can't figure out how to do this. The reason I would like to use C# is because I already have a lot of code written for Windows Phone that I would like to reuse.
Can anyone point me to how I would write a fairly efficient 2D tile/sprite MetroUI game for Win8? The only thing I can find uses C++ and DirectX.
[EDIT]
To clarify I do not care too much what I use (WinRT, DirectX...) so long as I can submit to the app store, and write my code in C#.
If you are familiar with the DirectX API, you can use SharpDX available via http://sharpdx.org. It is basically exposing DirectX APIs into C#. From my understanding, if you are going to upload apps to the store, the SharpDX should be fine and pass compliance, but I would look into it further before going too deep.
Also, as of this time, not all of the features are available (like Direct2d not fully certified for Win8 Metro).
If your game uses simple graphics, you can use Drawing Library for Modern UI, it exposes a GDI+ like interface to be used in XAML/C#/VB.NET Windows 8 Modern UI applications, it works by drawing to a XAML Canvas.
If you're looking for something quick and easy check out the "Physics Helper XAML" project;
http://physicshelperxaml.codeplex.com/
It's based on the farseer engine, and comes with sample apps. There are a few games already released using it.
http://www.andybeaulieu.com/Home/tabid/67/EntryID/223/Default.aspx
Have a look at:
[XAML images sample] (http://code.msdn.microsoft.com/windowsapps/0f5d56ae-5e57-48e1-9cd9-993115b027b9/sourcecode?fileId=102748&pathId=677969581)
The page and samples give some code for NineGrid and WriteableBitmap Image manipulation.
You can now use Win2D (open source, released by Microsoft for metro/WinRT apps) which provides hardware-accelerated 2D graphics rendering.
I am about to write a front end app, which will be used as a media center app. It will plug directly into a high definition TV. Essentially transforming my laptop into a media player. While this concept is not new, I want custom functionality, so this is why I am not reusing existing products.
I'm a C# developer, so the app should ideally be written in C#. And there is 1 other consideration, I need to accept input via the MCE Remote.
I was considering using Silverlight for this. Would you recommend this? Or any other recommendations for frameworks before I begin planning around this.
Thanks in advance.
This is the type of stuff that the Windows Presentation Foundation was meant for. You'll get a lot more access to the hardware than Silverlight would provide (I.E. that MCE remote you mentioned). You mark up your UI with vector graphics/XAML, and then perform the logic with C#.
EDIT: WPF also has support out of the box for animations which can make your UI a lot more interactive.
EDIT 2: Scott Hanselman has written a really cool application called BabySmash and posted the source online. It basically intercepts keyboard input and shows shapes and sounds on the computer. It's a good "child-proofing" method for your PC. The code could provide you with some insight into WPF and how to do the animations and interactivity that you're looking for.
Is this a desktop app? If so I would use WPF. Silverlight is a subset of WPF, so using WPF you could potentially do more.
Silverlight or WPF, if you want some extra power. Both have a similar programming model (with XAML and code-behind) so you might be able to start with Silverlight and move up to WPF if you need.
The VLC api might be useful for playing your media, someone has created a C# wrapper for it:
http://wiki.videolan.org/.Net_Interface_to_VLC
WPF is certainly the way to go, and for playing media check out the excellent WPF MediaKit: http://wpfmediakit.codeplex.com/ I've used it successfully in many projects.