Quantcast
Channel: VideoLan DotNet for WinForm, WPF
Viewing all 471 articles
Browse latest View live

New Post: Difference between Source Code and the Download Zip File And Magnify

$
0
0
I have tried "VlcContext.StartupOptions.AddOption("--video-filter=magnify");" in my application it worked well.
But my scenario is, i have more than one instance of VLC player control in my application and each control plays different videos.
when i use "VlcContext.StartupOptions.AddOption("--video-filter=magnify");" to enable magnifier,
it enables magnifier in all instance of vlc player.
I need to enable/disable magnifier in each instance of VLC separably. How can i achieve this?

New Post: Has anybody a working WPF sample?

$
0
0
Hi iPiv,
Have you found the c# code.
Please help me with one.
thank you

New Post: Using VideoLan DotNet in WPF application

$
0
0
Hey,

Thank you very much for the great library. We have been using it in our application FreeWorship. It uses the WPF library and we have managed to generate build a fairly decent video player using it. As we are using the WPF version we are also alpha blending text and images on top of the video.

Thank you very much for this project!
Peter

New Post: Has anybody a working WPF sample?

$
0
0
Hi alex_prvn,

Is this the sort of thing you're looking for. It's not dynamic, but should be a starting point for such a solution. It does however remove the VlcControl element from the Xaml.

Xaml:
<Window x:Class="VideoPlayerTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" Closing="MainWindow_OnClosing" 
        DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <Grid>
        <Grid>
            <Grid.Background>
                <VisualBrush Stretch="Uniform">
                    <VisualBrush.Visual>
                        <Image Source="{Binding Path=VideoSequence.Image}" />
                    </VisualBrush.Visual>
                </VisualBrush >
            </Grid.Background>
        </Grid>
    </Grid>
</Window>
Code Behind:
using System.ComponentModel;
using System.Windows;
using Vlc.DotNet.Core;

namespace VideoPlayerTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private VideoClass _videoSequence;

        public VideoClass VideoSequence { get { return _videoSequence; } }

        public MainWindow()
        {
            VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
            VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;

            //Set the startup options
            VlcContext.StartupOptions.IgnoreConfig = true;
            VlcContext.StartupOptions.LogOptions.LogInFile = true;
            VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = true;
            VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.Debug;

            // Disable showing the movie file name as an overlay
            VlcContext.StartupOptions.AddOption("--no-video-title-show");

            // Initialize the VlcContext
            VlcContext.Initialize();

            _videoSequence = new VideoClass();

            InitializeComponent();
        }

        private void MainWindow_OnClosing(object sender, CancelEventArgs e)
        {
            VlcContext.CloseAll(); 
        }
    }
}
VideoClass:
using System;
using System.ComponentModel;
using System.Windows.Media;
using Vlc.DotNet.Core;
using Vlc.DotNet.Core.Medias;
using Vlc.DotNet.Wpf;

namespace VideoPlayerTest
{
    public class VideoClass : INotifyPropertyChanged
    {
        /// <summary>
        /// Raised when a property on this object has a new value.
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Raises this object's PropertyChanged event.
        /// </summary>
        /// <param name="propertyName">The property that has a new value.</param>
        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                var e = new PropertyChangedEventArgs(propertyName);
                handler(this, e);
            }
        }

        private  VlcControl _vlcControl;

        public ImageSource Image
        {
            get { return _vlcControl.VideoSource; } }

        public VideoClass()
        {
            _vlcControl = new VlcControl
                {
                    Media = new PathMedia(@"C:\video.avi")
                };
            _vlcControl.PositionChanged += VlcControlOnPositionChanged;
        }

        private void VlcControlOnPositionChanged(VlcControl sender, VlcEventArgs<float> vlcEventArgs)
        {
            OnPropertyChanged("Image");
        }

        public void Play()
        {
            _vlcControl.Play();
        }
    }
}

New Post: Problem recording RTSP stream

$
0
0
I have VLC 2.0.6 installed and am using a Vivotek MD8562/8562D camera.

I have an implemention using VlcDotNet to record a RTSP stream from an IP Camera, but cannot get some desired features to work. When I connect to the camera with a pre-configured sdp file, everything works correctly:
_media = new LocationMedia("rtsp://192.168.2.105/live.sdp");
However if attempt to provide stream configuration details, as below (which defined the desired resolution, frame rate and video quality), I run into problems.
_media = new LocationMedia("rtsp://192.168.2.105/liveany.sdp?codectype=h264&resolution=1280x720&h264_ratecontrolmode=vbr&h264_quant=99&h264_qvalue=38&h264_maxframe=5");
After 10 seconds of the video buffering completing, I get the following messages in the log:
0c07dba8] live555 demux warning: no data received in 10s, eof ?
[0c080ea8] main input debug: EOF reached
[0c063148] main decoder debug: removing module "packetizer_h264"
[0c063148] main decoder debug: killing decoder fourcc `h264', 0 PES in FIFO
[0c06c6d0] main stream output debug: removing a sout input (sout_input:0c0cf5b0)

[0712da10] mux_mp4 mux debug: removing input
[0712da10] main mux warning: no more input streams for this mux
[0c07dba8] main demux debug: removing module "live555"
Opening connection to 192.168.2.105, port 554...
[0c080ea8] main input debug: Program doesn't contain anymore ES
It seems similar to a post I found on the VideoLan Forum Post

So I tried to use the same solution, and altered the StartupOption to include --rtsp-tcp, but still with no success.
VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;

//Set the startup options
VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = true;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = true;
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.Debug;

// Disable showing the movie file name as an overlay
VlcContext.StartupOptions.AddOption("--no-video-title-show");

VlcContext.StartupOptions.AddOption("--no-audio");
VlcContext.StartupOptions.AddOption("--rtsp-tcp");
            
VlcContext.Initialize();
In order to save the the video stream to file I also include this option in the LocationMedia object:
_media.AddOption(":sout=#transcode{}:std{access=file,mux=mp4,dst=" + filepath + "}");
The RTSP stream is provided in H.264 format, which is what I want it saved in so no transcoding is necessary. Anyone got any ideas as to why this would work correctly for the live.sdp stream but not the liveany.sdp stream?

I can provide the full log details if that would help.

Thanks,
Brian

New Post: Recording & Transcoding

$
0
0
Hello all,

I have been cracking my head regarding this, I am trying to record a video stream to a video file locally, the stream is in 4:3 aspect ratio and i would like to change that aspect ratio to 16:9 in the video file that is being saved locally.

The code below doesn't work. It is all done in .net C#.
media.AddOption(":sout=#transcode{vcodec=h264,vb=1024,aspect-ratio=16:9,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=avi,dst=D:\\output.avi}");
I have tried many other methods, and i have went and recompile the Vlc.DotNet.Forms.dll so as to be able to change aspect ratio on the VlcControl as well, it is working well for the control , but it seems like no matter what options i tried to put in the media.AddOption transcoding, the video size and ratio doesn't get affected.

I really need some help regarding this and hope someone here can point me in the right direction.

New Post: Recording & Transcoding

$
0
0
Hi,

Are you sure “aspect-ratio” is a valid transcode parameter?

VLC User Guide Chapter 4 - see the Transcode section.

I would suggest trying to perform the required video conversion directly in VLC. If it works there, you can find the “using sout chain” used by VLC in the debug messages (Tools->Messages, with Verbosity set to debug).

This Vlc Forum post may also be of interest.

Hope that helps.

Commented Issue: vlccontrol freeze application (wait cursor mouse appears and application stop responding [6496]

$
0
0
VLC control freeze with mpg and avi if:
end of video
load another video (send stop command don't change effect)
Comments: ** Comment from web user: snapcoyote **

Thanks HAL_9000! Your code worked for me.


New Post: vlcdotnet vb.net

$
0
0
i have a problem for use a vlcdotnet for vb.net 2008
i don't know to add file media like xx.mkv to list of vlccontrol1
and select and play
thank you
sorry for my english

New Post: vlcdotnet vb.net

$
0
0
sorry i dont have hello to all :)

New Comment on "Presentation of Vlc.DotNet alpha 2"

$
0
0
@raj - hello, can you please upload a full project of this example. It will great for me and others who are new to C# ? I could not get this to work.

Commented Issue: DotNet.Wpf does not work with MVVM [7217]

$
0
0
I wrote a simple WPF test program and it works great. However, when I put the code into a new WPF program created with an MVVM Lite template, I get the following error:

System.BadImageFormatException was unhandled
Message=Could not load file or assembly 'Vlc.DotNet.Wpf, Version=1.2.0.0, Culture=neutral, PublicKeyToken=84529da31f4eb963' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I tried a blank MVVM Lite template with just the initialization code and I get the following error:

System.ComponentModel.Win32Exception was unhandled
Message=%1 is not a valid Win32 application
Source=Vlc.DotNet.Core.Interops
ErrorCode=-2147467259
NativeErrorCode=193
Comments: ** Comment from web user: gemelo **

did you try to change the architecture (x64/x86)?

New Post: Using in WinCE

$
0
0
Hi to the author of this project. I would like to know if this API will work or can I use this in a WinCE Project?

Thanks hoping for your response

New Post: Video brightness

$
0
0
How can i change video brightness/contrast? I only found this solution. But it changes brightness for all videos to the same brightness and i cant change it while the programm is running anymore.
            VlcContext.StartupOptions.AddOption("--video-filter=adjust");
            VlcContext.StartupOptions.AddOption("--brightness=1.3");
            VlcContext.Initialize();
I tried the following. but it does not work. nothing happens:
MediaBase p = new PathMedia(path);
p.AddOption(":video-filter=adjust");
p.AddOption(":brightness=1.3");
or:
p.AddOption(":video-filter=adjust:brightness");
p.AddOption(":brightness=1.3");
or:
p.AddOption("--video-filter=adjust");
p.AddOption("--brightness=1.3");
and much more....

New Post: Play video from memory stream or byte array

$
0
0
Hi all,

any news on the sample code?

Thanks for your help.

New Post: Random freezes playing or stopping or pausing video

$
0
0
2 years old thread and bug is still not fixed. It randomly crashes on stop() or play() if i dont stop before play.

Really annoying bug. I used VLC 1.1.9 with a c# wrapper (not vlcdot.net) and now switched to vlcdot.net with vlc v2.0.6 and it still freezes randomly.

I had the best results, when i start (a few) new threads with only "vlc.Stop()" and wait till it was processed and just go on with "vlc.play()" if it was not processed in e.g. 10 seconds...


windows 7 x64. vlc compiled x86

Closed Task: VlcLogOptions.Verbosities.Debug doesn't exist (Must update doc) [6177]

$
0
0
I'm following the WPF example having copied the dlls and referenced in my project and have copied the code from; http://vlcdotnet.codeplex.com/wikipage?title=Wpf
 
However I get the following error;
Error 1 'Vlc.DotNet.Core.VlcLogOptions' does not contain a definition for 'Verbosities'
 
I've noticed VlcLogOptions.Verbosities.Debug associated classes. Intellisense shows nothing.

Closed Issue: Message=%1 is not a valid Win32 application [6132]

$
0
0
What the heck is this?
 
System.ComponentModel.Win32Exception was unhandled
Message=%1 is not a valid Win32 application
Source=Vlc.DotNet.Core.Interops
ErrorCode=-2147467259
NativeErrorCode=193
StackTrace:
at Vlc.DotNet.Core.Interops.LibVlcInteropsManager.InitVlcLib(String libVlcDllsDirectory)
at Vlc.DotNet.Core.Interops.LibVlcInteropsManager..ctor(String libVlcDllsDirectory)
at Vlc.DotNet.Core.VlcContext.Initialize()
at AmsiosCE.Program.Main() in C:\Users\wojcik\Documents\Visual Studio 2010\Projects\AMSIOS - VLC\MediaMapCE\Program.cs:line 28
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
 
Oh,, and what happened to FileMedia and VolumeLevel? Can't play a file or tell it how loud not to play it? :^p

Closed Issue: Application not shuts down Correctly [6130]

$
0
0
Hello
 
I work with the Source Code 62051, on a Windows 7 64Bit.
 
If i start the Player play a movie and close the Windows Form application.
It not gets closesd fully. It hangs.
 
When i break the Debug i see it Hangs on the Line:

VlcContext.InteropManager.MediaPlayerInterops.Stop.Invoke(VlcContext.HandleManager.MediaPlayerHandles[this]);
in the File VlcControl.Common function public void Stop();
 
However if i stop the movie before i close the app it closes fully and goes back to Visual Studio.
 
I tried to fix the issue with a FormClose/Closing Event without any luck. If i try to stop the movie there the same Problem happens, i guess some Reference is not there anymore.
 
Second Thing:
 
Had to fix the Take_Snapshot function in Order to compile. Otherwise it is working fine.
 
public void TakeSnapshot(string filePath, uint width, uint height)
{
if (VlcContext.InteropManager != null &&
VlcContext.InteropManager.MediaPlayerInterops != null &&
VlcContext.InteropManager.MediaPlayerInterops.VideoInterops.TakeSnapshot.IsAvailable)
{
Dispatcher.BeginInvoke(DispatcherPriority.Background,
(Action)(() => VlcContext.InteropManager.MediaPlayerInterops.VideoInterops.TakeSnapshot.Invoke(VlcContext.HandleManager.MediaPlayerHandles[this], 0, StringToByteArray(filePath), width, height)));
}
}
private byte[] StringToByteArray(string str)
{
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
return enc.GetBytes(str);
}
 
Third:
 
When will the In Memory Snapshot function appear?
 
Forth:
 
vlcControl1.IsSeekable is missing.
vlcControl1.CanPause is missing.
 
Best Regrads and keep up that good Work
Really like the Api soon i use WPF as well to test that thing out :)

New Post: How can I use my own control to display video

$
0
0
Hi,

I don't want to use VlcControl to display the video. How can i use my own window handle may be a picture box or panel.

Any sample code will be much appreciated.

Thanks
Sc
Viewing all 471 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>