hello I got a problem with my conversion code when I subscribe OnProgress I got external error
System.FormatException
HResult=0x80131537
Message=String was not recognized as a valid TimeSpan.
Source=System.Private.CoreLib
StackTrace:
at System.Globalization.TimeSpanParse.TimeSpanResult.SetFailure(ParseFailureKind kind, String resourceKey, Object messageArgument, String argumentName)
at System.Globalization.TimeSpanParse.ProcessTerminal_HM(TimeSpanRawInfo& raw, TimeSpanStandardStyles style, TimeSpanResult& result)
at System.Globalization.TimeSpanParse.ProcessTerminalState(TimeSpanRawInfo& raw, TimeSpanStandardStyles style, TimeSpanResult& result)
at System.Globalization.TimeSpanParse.TryParseTimeSpan(ReadOnlySpan`1 input, TimeSpanStandardStyles style, IFormatProvider formatProvider, TimeSpanResult& result)
at Xabe.FFmpeg.FFmpegWrapper.GetDuration(DataReceivedEventArgs e, Regex regex, String args)
at Xabe.FFmpeg.FFmpegWrapper.CalculateTime(DataReceivedEventArgs e, String args, Int32 processId)
at System.Diagnostics.Process.ErrorReadNotifyUser(String data)
at System.Diagnostics.AsyncStreamReader.FlushMessageQueue(Boolean rethrowInNewThread)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Diagnostics.AsyncStreamReader.<>c.<FlushMessageQueue>b__17_0(Object edi)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
This exception was originally thrown at this call stack:
[External Code]
hello, I'm trying to initialize MediaInfo with an rtsp stream, but I keep receiving the message "Invalid file. Cannot load file rtsp://192.168.1.100:554/stream1". I've tested with the following streams as well:
rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen02.stream
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
with the same result
Could not find codec parameters for stream 1 (Video: h264, none, 240x160): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, rtsp, from 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov':
Metadata:
title : BigBuckBunny_115k.mov
Duration: 00:09:56.48, start: 0.000000, bitrate: N/A
Stream #0:0: Audio: aac, 12000 Hz, stereo, fltp
Stream #0:1: Video: h264, none, 240x160, 90k tbr, 90k tbn, 180k tbc
this is the console response
that works! thank you! Regarding the following method:
IConversionResult conversionResult = await FFmpeg.Conversions.New()
.AddStream(videoStream)
.ExtractEveryNthFrame(1, outputFileNameBuilder)
.Start();
Is there a way to retrieve this image as a bitmap instead of saving it to a folder?
If not, is there a way to overwrite the previously saved image instead of repeatedly writing to a new file?
Hello everyone! I need help with one question. I have task: get rtsp stream, and record it into file. I get code from documentation:
IMediaInfo mediaInfo = await FFmpeg.GetMediaInfo( url );
IStream videoStream = mediaInfo.VideoStreams.FirstOrDefault()?.SetCodec( VideoCodec.H264 );
IStream audioStream = mediaInfo.AudioStreams.FirstOrDefault()?.SetCodec( AudioCodec.Aac );
FFmpeg.Conversions.New().AddStream( audioStream, videoStream ).SetOutput( outputPath ).Start();
But... i have some errors in it: mediaInfo.VideoStreams don't have method FirstOrDefault, audioStream the same (the same about First() method). and codecs doesn't containt H264
Well, i tryed to get result, but...
IMediaInfo mediaInfo = await FFmpeg.GetMediaInfo( url );
IStream videoStream = mediaInfo.VideoStreams.FirstOrDefault()?.SetCodec(VideoCodec.h264) ;
IStream audioStream = mediaInfo.AudioStreams.First()?.SetCodec( AudioCodec.aac );
var result = await FFmpeg.Conversions.New().AddStream( audioStream, videoStream ).SetOutput( "d:\\out.mp4" ).Start();
FFmpeg.GetMediaInfo( url ); - don't return anything. May be i can see some logs for understanding my problem?
in url variable: rtsp://admin:admin@10.8.0.174:554/ch01/0