We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我想用代码 执行 如下推流命令, 代码需要怎么写? .\ffmpeg -i "rtsp://admin:@192.168.58.89:554/channel=1_stream=0" -pix_fmt yuv420p -vcodec libx264 -an -f flv "rtmp://192.168.99.100:1935/live/stream0"
看完例子还是不太会写, 是一定要从inputContext每帧读取再写到outputContext吗? FFmpegLogger.LogWriter = (level, msg) => Debug.WriteLine(msg);
using FormatContext inFc = FormatContext.OpenInputUrl("rtsp://admin:@192.168.58.89:554/channel=1_stream=0"); inFc.LoadStreamInfo();
MediaStream inVideoStream = inFc.GetVideoStream();
using FormatContext outFc = FormatContext.AllocOutput(formatName: "flv"); IOContext io = IOContext.OpenWrite("rtmp://192.168.99.100:1935/live/stream0"); outFc.Pb = io;
MediaStream videoStream = outFc.NewStream(Codec.FindDecoderByName("h264_cuvid")); videoStream.TimeBase = inVideoStream.RFrameRate.Inverse(); videoStream.SampleAspectRatio = inVideoStream.SampleAspectRatio;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我想用代码 执行 如下推流命令, 代码需要怎么写?
.\ffmpeg -i "rtsp://admin:@192.168.58.89:554/channel=1_stream=0" -pix_fmt yuv420p -vcodec libx264 -an -f flv "rtmp://192.168.99.100:1935/live/stream0"
看完例子还是不太会写, 是一定要从inputContext每帧读取再写到outputContext吗?
FFmpegLogger.LogWriter = (level, msg) => Debug.WriteLine(msg);
using FormatContext inFc = FormatContext.OpenInputUrl("rtsp://admin:@192.168.58.89:554/channel=1_stream=0");
inFc.LoadStreamInfo();
MediaStream inVideoStream = inFc.GetVideoStream();
using FormatContext outFc = FormatContext.AllocOutput(formatName: "flv");
IOContext io = IOContext.OpenWrite("rtmp://192.168.99.100:1935/live/stream0");
outFc.Pb = io;
MediaStream videoStream = outFc.NewStream(Codec.FindDecoderByName("h264_cuvid"));
videoStream.TimeBase = inVideoStream.RFrameRate.Inverse();
videoStream.SampleAspectRatio = inVideoStream.SampleAspectRatio;
The text was updated successfully, but these errors were encountered: