Capturing a still from a RTSP stream
-
Good morning, I'm trying to capture an image from a RTSP stream using ffmpeg. I'm struggling, it is as if ffmpeg isnt working. A snip from my code is below:
using System.Runtime.InteropServices;
using FFmpeg.AutoGen;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Formats;Class Program
{
unsafe static void Main(string[] args)
{
string inputUrl = "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4";ffmpeg.avformat_open_input(&pFormatContext, inputUrl, null, null);
The error that I'm receiving which is related to the last line of code is:
System.NotSupportedException
HResult=0x80131515
Message=Specified method is not supported.
Source=FFmpeg.AutoGen
StackTrace:
at FFmpeg.AutoGen.DynamicallyLoadedBindings.<>c.b__2_1284(AVFormatContext** , String , AVInputFormat* , AVDictionary** )
at FFmpeg.AutoGen.ffmpeg.avformat_open_input(AVFormatContext** ps, String url, AVInputFormat* fmt, AVDictionary** options)
at Program.Main(String[] args)Any help would be appreciated, Freddie
-
Good morning, I'm trying to capture an image from a RTSP stream using ffmpeg. I'm struggling, it is as if ffmpeg isnt working. A snip from my code is below:
using System.Runtime.InteropServices;
using FFmpeg.AutoGen;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Formats;Class Program
{
unsafe static void Main(string[] args)
{
string inputUrl = "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4";ffmpeg.avformat_open_input(&pFormatContext, inputUrl, null, null);
The error that I'm receiving which is related to the last line of code is:
System.NotSupportedException
HResult=0x80131515
Message=Specified method is not supported.
Source=FFmpeg.AutoGen
StackTrace:
at FFmpeg.AutoGen.DynamicallyLoadedBindings.<>c.b__2_1284(AVFormatContext** , String , AVInputFormat* , AVDictionary** )
at FFmpeg.AutoGen.ffmpeg.avformat_open_input(AVFormatContext** ps, String url, AVInputFormat* fmt, AVDictionary** options)
at Program.Main(String[] args)Any help would be appreciated, Freddie
You'll probably have better luck reporting this as an issue in the GitHub project - assuming it hasn't already been reported: Issues · Ruslan-B/FFmpeg.AutoGen · GitHub[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Good morning, I'm trying to capture an image from a RTSP stream using ffmpeg. I'm struggling, it is as if ffmpeg isnt working. A snip from my code is below:
using System.Runtime.InteropServices;
using FFmpeg.AutoGen;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Formats;Class Program
{
unsafe static void Main(string[] args)
{
string inputUrl = "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4";ffmpeg.avformat_open_input(&pFormatContext, inputUrl, null, null);
The error that I'm receiving which is related to the last line of code is:
System.NotSupportedException
HResult=0x80131515
Message=Specified method is not supported.
Source=FFmpeg.AutoGen
StackTrace:
at FFmpeg.AutoGen.DynamicallyLoadedBindings.<>c.b__2_1284(AVFormatContext** , String , AVInputFormat* , AVDictionary** )
at FFmpeg.AutoGen.ffmpeg.avformat_open_input(AVFormatContext** ps, String url, AVInputFormat* fmt, AVDictionary** options)
at Program.Main(String[] args)Any help would be appreciated, Freddie
-
Good morning, I'm trying to capture an image from a RTSP stream using ffmpeg. I'm struggling, it is as if ffmpeg isnt working. A snip from my code is below:
using System.Runtime.InteropServices;
using FFmpeg.AutoGen;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Formats;Class Program
{
unsafe static void Main(string[] args)
{
string inputUrl = "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4";ffmpeg.avformat_open_input(&pFormatContext, inputUrl, null, null);
The error that I'm receiving which is related to the last line of code is:
System.NotSupportedException
HResult=0x80131515
Message=Specified method is not supported.
Source=FFmpeg.AutoGen
StackTrace:
at FFmpeg.AutoGen.DynamicallyLoadedBindings.<>c.b__2_1284(AVFormatContext** , String , AVInputFormat* , AVDictionary** )
at FFmpeg.AutoGen.ffmpeg.avformat_open_input(AVFormatContext** ps, String url, AVInputFormat* fmt, AVDictionary** options)
at Program.Main(String[] args)Any help would be appreciated, Freddie
Myself it just seemed like an interesting problem. So I googled using the following
capture an image from a RTSP stream still shot
Interesting that they mention this tool right away. This one seems useful https://stackoverflow.com/questions/25360470/ffmpeg-capture-current-frame-and-overwrite-the-image-output-file[^] So the tool itself will capture it as long as the correct options are provided. Another link suggests that streams can be corrupted because, not surprisingly, streams can drop packets.