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

New Post: Play stream RTSP

$
0
0
Hello,

I have VLC 2.1.3 and use Logitech HD Pro Webcam C920.

I tried play stream with RTSP but cannot work. I get information about "failed to open/read to DVD". This code is right? What change in this code?
Vlc.DotNet.Core.Medias.MediaBase media = new Vlc.DotNet.Core.Medias.PathMedia(":dshow-vdev=USB2.0 Camera :dshow-adev=\"Logitech HD Pro Webcam C920\":live-caching=300");
            if (media != null)
            {
                media.AddOption("#transcode{vcodec=h264,vb=0,scale=0,acodec=mpga,ab=128,channels=2,samplerate=44100}:#rtp{dst=10.132.15.154,sdp=rtsp://10.132.15.154:8554/usb1}");
                VlcControl control = new VlcControl();
                control.Media = media;
                control.Play();
            }

New Post: Mute dont work/

$
0
0
Doing it in a loop just freezes it up.

I give it one of these:

vlcControl1.PositionChanged += vlcControl1_PositionChanged;

void vlcControl1_PositionChanged(VlcControl sender, Vlc.DotNet.Core.VlcEventArgs<float> e)
    {
        vlcControl1.AudioProperties.Volume = 0;
    }

Still there's a 1 seconds delay before it kicks in, less than ideal.

New Post: How is an error state cleared in the VLC control?

$
0
0
My project uses a VlcControl to display a play list of videos. If an error occurs in one of the videos (ex, file not found), the VlcControl enters an error state. The VlcControl no longer functions at this point.

Is there a way to get the error message? Can I clear the error state and continue?

I have tried calling GetErrorMessage and ClearError from the VlcContext but those don't seem to do anything.

New Post: Instances to play and record

$
0
0
Hi, guys.

I'm writing a app to play some videos (file and stream from IP cameras) and record too.
All of this must work simultaneously.
The problem is which, sometimes, I can't record videos when I'm playing videos. And, to record, I have to use 2 controls: 1 to record and 1 to view. I can't use the same control to record and see what I'm recording.
Sometimes I get the error:
"Could not load file or assembly 'Vlc.DotNet.Core.Interops, Version=1.2.0.0, Culture=neutral, PublicKeyToken=84529da31f4eb963' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)"

program.cs
VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;

VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = true;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = false;
VlcContext.StartupOptions.LogOptions.Verbosity = debug ? VlcLogVerbosities.Debug : VlcLogVerbosities.None;

VlcContext.Initialize();

Application.Run(new Principal());

VlcContext.CloseAll();
my form
private void PlayVideo(string url)
{
    var media = new LocationMedia(url);
    vlcControl1.Media = media;
    vlcControl1.Play();
}

private void RecordVideo(string url)
{
    string path = Principal._Config.DiretórioRec;

    if (!Directory.Exists(path))
    {
    Directory.CreateDirectory(path);
    }

    if (Evento.cameraPreset.camera != null)
    {
    path = Principal._Config.DirectoryRec + @"\" + Evento.cameraPreset.camera.tower.name;

    if (!Directory.Exists(path))
    {
        Directory.CreateDirectory(path);
    }

    var arq = path + @"\" + Evento.arquivoVideo;

    var media = new LocationMedia(url);
    media.AddOption(":sout=#transcode{vcodec=theo,vb=800,scale=1,acodec=flac,ab=128,channels=2,samplerate=44100} :std{access=file,mux=ogg,dst=" + arq + "}");
    vlcControl2.Media = media;
    vlcControl2.Visible = false;
    vlcControl2.Playing += vlcControl2_Playing;
    vlcControl2.Play();
    }
}
vlcControl2_Playing just check if is time to stop recording.

How to work with multiple instances (read/write) of this library? Something with threads?

New Post: Mute dont work/

$
0
0
Also give it one of these to fix :)
        vlcControl1.Buffering += vlcControl1_Buffering;

    void vlcControl1_Buffering(VlcControl sender, Vlc.DotNet.Core.VlcEventArgs<float> e)
    {
        vlcControl1.AudioProperties.Volume = 0;
    }

New Post: Instances to play and record

$
0
0
Use timer to stop vlc recording and you can announce many instances as you want!

New Post: Play stream RTSP

$
0
0
PathMedia only use for playing local video. when playing stream video you should use location like this:
media = new LocationMedia(url_source_protocol_stream_out) - that's enough to play a stream!
Your code:
media.AddOption("#transcode{vcodec=h264,vb=0,scale=0,acodec=mpga,ab=128,channels=2,samplerate=44100}:#rtp{dst=10.132.15.154,sdp=rtsp://10.132.15.154:8554/usb1}");
it is about streaming this video to new url with transcode

New Post: Multiple Instances

$
0
0
Yes, you can!
you can create how many instances as you want, and then just add urls by using locationMedia(url) to play the stream in this url.

New Post: Instances to play and record

$
0
0
Thank you leho for your reply.

I'm already using timers to stop recording.
The problem is which I can't start many instances without problems.
I think I have some problem with options of AddOption.

Commented Unassigned: Incompatibility? with release 2014.04.18 and previous [7810]

$
0
0
Need help resolving this issue? Maybe bug? Don't understand why a DVD reference in the log keeps popping up, not trying to record from dvd.

Ok, the latest greatest version was available so I update both VLC and VLC Dot.Net and have these issues;

Updated to the latest release: 2014.04.18
and get an error while trying to save stream to file. Previous version worked OK.
Trying to save from this stream:
"http://videos.testtube.com/revision3/web/discoverydinosaurs/0052/discoverydinosaurs--0052--dinosaur-hour-kids--hd720p30.h264.mp4"
-----Setup
Installed latest version of VLC 2.1.3 Rincewind
Created VS Studio 2012 project including references to version 2014.04.18:
Vlc.DotNet.Core
Vlc.DotNet.Core.Interops
Vlc.DotNet.Forms
-----Init Code
VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;//CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
// Ignore the VLC configuration file
VlcContext.StartupOptions.IgnoreConfig = true;
// Enable file based logging
VlcContext.StartupOptions.LogOptions.LogInFile = true;
// Shows the VLC log console (in addition to the applications window)
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = true;
// Set the log level for the VLC instance
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.Debug;
// Initialize the VlcContext
VlcContext.Initialize();
-----Code, in part
//Called to start a recording process
public void Record(string url, string fileName, int durration)
{
//Persist parameters to instance fields
_finalFilename = fileName;
//Destination file name is initially a guid later to be moved and renamed upon completion
//_tempPath was previously defined as "f:/MediaArchive"
_tempFilename = System.IO.Path.Combine(_tempPath + Guid.NewGuid().ToString()+".mp4");
_WasError = false; //indicate no error
_IsFinished = false; //indicate successful completion of task
//Timer used to control duration of recording
this.secondsToRecord = durration * 60; //Want seconds
timeStarted = DateTime.Now;
timeToComplete = timeStarted.AddMinutes(durration);

//Media to record
var media = new PathMedia(url);
// Original options that worked well in previous version
// string options = ":sout=#transcode{}:duplicate{dst=std{access=file,mux=mp4,dst=" + _tempFilename + "}}"; //works with display
// tried to resolve issue with the following option removing the duplicate param
string options = ":std{access=file,mux=mp4,dst=" + _tempFilename + "}"; //works with display
//Verified the incoming parameters were correct
System.Windows.Forms.MessageBox.Show(url);
//Catch possible errors from vlc
vlc.EncounteredError += vlc_EncounteredError;
//Call owner thread manager indicating process started
UpdateEvents(_finalFilename, durration, 0, false,false);
//Setup the media options
media.AddOption(options);
//Setup the media MRL and start the process
vlc.Media = media;
//Start the timer used to stop the recording after X minutes
t1.Enabled = true;
}


----- LOG FILE
-- logger module started --
main debug: VLC media player - 2.1.3 Rincewind
main debug: Copyright © 1996-2014 the VideoLAN team
main debug: revision 2.1.3-0-ge6a71cc
main debug: configured with ../extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-x264' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--disable-sdl' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--disable-dirac' '--host=i686-w64-mingw32' 'host_alias=i686-w64-mingw32'
main debug: using interface module "logger"
main debug: looking for interface module matching "logger,none": 15 candidates
logger: VLC media player - 2.1.3 Rincewind
logger: Copyright © 1996-2014 the VideoLAN team
logger:
Warning: if you cannot access the GUI anymore, open a command-line window, go to the directory where you installed VLC and run "vlc -I qt"

logger: using logger.
logger debug: opening logfile `vlc-log.txt'
-- logger module started --
main debug: VLC media player - 2.1.3 Rincewind
main debug: Copyright © 1996-2014 the VideoLAN team
main debug: revision 2.1.3-0-ge6a71cc
main debug: configured with ../extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-x264' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--disable
Comments: Is it possible that you are using the wrong uri kind? i had something simmilar and started using this wherever i load a url ``` if (sourcetype == "relative") { player.Media = new PathMedia(src); } if (sourcetype == "absolute") { player.Media = new LocationMedia(src); } ```

New Post: Instances to play and record

$
0
0
Hi theo2f!
Sometimes I faced this problem.
You only can view or record may be the reason is UDP stream, this only allow one job!
The solution is: You can add option to one instance to recording and view simultaneously.

What about this error: "the process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)"

When you start new instance media (timer to stop and record again) you should stop current instance (.stop()) may be better after that dispose it and then add it again!
Hope these help you of the problems!

New Post: VLC need 10-30% CPU, but VlcControl 95-99%

$
0
0
idanpat wrote:
Same here.
Moving to WPFMediaKit helped..
Can say more about it, thanks!

Created Unassigned: VLC media player need 10-30% CPU, but VlcControl 70-99% [7818]

$
0
0
I have the same problem wich some other users. The CPU load is very high. I use vs2010 and Framework 4.0

Remarks: C# Forms App do not have this problem.

My code:
```
VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = false;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = false;
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.None;
VlcContext.StartupOptions.AddOption("--ffmpeg-hw");
VlcContext.StartupOptions.AddOption("--no-video-title-show");

VlcContext.Initialize();

VlcControl player = new VlcControl();

Binding bing = new Binding("VideoSource");
bing.Source = player;

Image img = new Image();
img.SetBinding(Image.SourceProperty, bing);

VisualBrush vBrush = new VisualBrush();
vBrush.TileMode = TileMode.None;
vBrush.Stretch = Stretch.Uniform;
vBrush.Visual = img;

parentGrid.Background = vBrush;

var media = new LocationMedia("rtsp://admin:12345@10.10.8.33:554");
player.Play(media);
```

Please Help!!!

New Post: Reduce CPU performance ?

$
0
0
I have the same problem, are you have a solution?

New Post: How to reduce CPU performance to lowest

$
0
0
I have the same question, are you have a solution?

New Post: High CPU usage? Whats going on here?

Commented Unassigned: VLC media player need 10-30% CPU, but VlcControl 70-99% [7818]

$
0
0
I have the same problem wich some other users. The CPU load is very high. I use vs2010 and Framework 4.0

Remarks: C# Forms App do not have this problem.

My code:
```
VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = false;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = false;
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.None;
VlcContext.StartupOptions.AddOption("--ffmpeg-hw");
VlcContext.StartupOptions.AddOption("--no-video-title-show");

VlcContext.Initialize();

VlcControl player = new VlcControl();

Binding bing = new Binding("VideoSource");
bing.Source = player;

Image img = new Image();
img.SetBinding(Image.SourceProperty, bing);

VisualBrush vBrush = new VisualBrush();
vBrush.TileMode = TileMode.None;
vBrush.Stretch = Stretch.Uniform;
vBrush.Visual = img;

parentGrid.Background = vBrush;

var media = new LocationMedia("rtsp://admin:12345@10.10.8.33:554");
player.Play(media);
```

Please Help!!!
Comments: why don't you try use window form vlc control? also try to avoid "--ffmpeg-hw"!

Commented Unassigned: VLC media player need 10-30% CPU, but VlcControl 70-99% [7818]

$
0
0
I have the same problem wich some other users. The CPU load is very high. I use vs2010 and Framework 4.0

Remarks: C# Forms App do not have this problem.

My code:
```
VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = false;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = false;
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.None;
VlcContext.StartupOptions.AddOption("--ffmpeg-hw");
VlcContext.StartupOptions.AddOption("--no-video-title-show");

VlcContext.Initialize();

VlcControl player = new VlcControl();

Binding bing = new Binding("VideoSource");
bing.Source = player;

Image img = new Image();
img.SetBinding(Image.SourceProperty, bing);

VisualBrush vBrush = new VisualBrush();
vBrush.TileMode = TileMode.None;
vBrush.Stretch = Stretch.Uniform;
vBrush.Visual = img;

parentGrid.Background = vBrush;

var media = new LocationMedia("rtsp://admin:12345@10.10.8.33:554");
player.Play(media);
```

Please Help!!!
Comments: my project is wpf application, so wpf vlc control is more Compatible. "--ffmpeg-hw" had no effect.

Created Unassigned: Memory leak when streaming video [7819]

$
0
0
Do anyone observe memory leak when streaming a video, I got this problem and usually the program stops after sometime!
any help or idea will be great!
thanks!

New Post: rtsp stream

Viewing all 471 articles
Browse latest View live


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