Reputation: 1
This is my .csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="gstreamer-sharp-netcore" Version="0.0.8" />
</ItemGroup>
When I run my C# script:
var rtspsrc = ElementFactory.Make("rtspsrc", "source");
var rtph264depay = ElementFactory.Make("rtph264depay", "depay");
var h264parse = ElementFactory.Make("h264parse", "parser");
var mpegtsmux = ElementFactory.Make("mpegtsmux", "muxer");
var hlssink = ElementFactory.Make("hlssink", "sink");
// Elements Config
rtspsrc["location"] = rtspUrl;
rtspsrc["latency"] = 200;
hlssink["location"] = $"{directoryPath}\\%06d.ts";
hlssink["target-duration"] = 5;
hlssink["playlist-location"] = hlsOutputPath;
// Pipeline Creation
var pipeline = new Pipeline("hls-pipeline");
// Linking
rtspsrc.Link(rtph264depay);
rtph264depay.Link(h264parse);
h264parse.Link(mpegtsmux);
mpegtsmux.Link(hlssink);
// Add to pipe
pipeline.Add(rtspsrc, rtph264depay, h264parse, mpegtsmux, hlssink);
// start pipe
var ret = pipeline.SetState(State.Playing);
if (ret == StateChangeReturn.Failure)
{
Console.WriteLine("Unable to set the pipeline to the playing state.");
return;
}
// Main Loop
GLib.MainLoop mainLoop = new GLib.MainLoop();
mainLoop.Run();
// dispose...
pipeline.SetState(State.Null);
I get this error on the console:
Error: Unable to load DLL 'gstreamer-1.0-0.dll' or one of its dependencies: Não foi possível encontrar o módulo especificado. (0x8007007E)
I'm using
The error occurs when this line is called:
var rtspsrc = ElementFactory.Make("rtspsrc", "source");
The first line that uses the Gstreamer sharp library.
The .dll
is in a folder that was created when I installed Gstreamer on my machine, I put the paths in the environment variables so that GSTREAMER could use
Screen Capture of Enviroment Variables
What didn't make sense is that when I run something like this:
var pipeline = Parse.Launch("playbin uri=http://download.blender.org/durian/trailer/sintel_trailer-1080p.mp4");"
it works...
I have already configured the GStreamer ENVIRONMENT PATH paths. I'am a really newbie so could someone explain it to me?
I need GSTREAMER to generate the .ts
and .m3u8
files. But it's causing that DLL error.
Upvotes: 0
Views: 119