[英]How to transcode raw uncompressed RTP to an H264 RTSP stream
I am new to streaming and am trying to figure out how to transcode streams via ffmpeg. 我是流媒体的新手,正在尝试弄清楚如何通过ffmpeg对流进行转码。
I have a few raw rtp uncompressed streams where some are on address 239.xxx and others are on 169.xxx 我有一些原始的rtp未压缩流,其中一些位于地址239.xxx,另一些位于169.xxx
I want to setup an RTSP server to grab those streams and transcode them into H264 and stream them out to a new address and port. 我想设置一个RTSP服务器来获取这些流并将它们转码为H264,然后将其流式传输到新的地址和端口。
I have tried some ffmpeg commands but I keep getting errors about having to compile ffmpeg with pthreads. 我已经尝试了一些ffmpeg命令,但是由于必须使用pthreads编译ffmpeg,我不断收到错误消息。
I have no idea how to do that so does anyone know what commands I can use that will work with the current windows version of ffmpeg? 我不知道该怎么做,所以有人知道我可以使用哪些命令与ffmpeg的当前Windows版本一起工作吗?
For now, I am just trying to save the stream to a file to see if that works. 现在,我只是试图将流保存到文件中以查看是否可行。 Command I am using is:
我正在使用的命令是:
ffmpeg -i rtp://224.1.1.10:6972 transcoded test.mp4
and the return I get in the command line is 我在命令行中得到的回报是
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.3.1 (GCC) 20190414
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[udp @ 000002cb292abf40] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 000002cb292bc200] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
rtp://224.1.1.10:6972: Immediate exit requested
Exiting normally, received signal 2.
Try TCP instead of UDP. 尝试使用TCP代替UDP。 If your server outputs TCP you can try adding the input option(s)
-rtsp_flags prefer_tcp
and/or -rtsp_transport tcp
(place them before -i
). 如果服务器输出TCP,则可以尝试添加输入选项
-rtsp_flags prefer_tcp
和/或-rtsp_transport tcp
(将它们放在-i
之前)。
Or use a build of ffmpeg
that supports pthreads. 或使用支持pthread的
ffmpeg
构建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.