Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从NGINX-RTMP实时模式提取时的音频视频延迟_Nginx_Video_Ffmpeg_Rtsp_Rtmp - Fatal编程技术网

从NGINX-RTMP实时模式提取时的音频视频延迟

从NGINX-RTMP实时模式提取时的音频视频延迟,nginx,video,ffmpeg,rtsp,rtmp,Nginx,Video,Ffmpeg,Rtsp,Rtmp,我们得到一个RTSP流,并将其与pulseaudio上的线路混合在一起 这看起来像: ffmpeg \ -use_wallclock_as_timestamps 1 -fflags +genpts \ -max_delay 2000000 -thread_queue_size 1024 \ -i "rtsp://url" \ -use_wallclock_as_timestamps 1 -fflags +genpt

我们得到一个RTSP流,并将其与pulseaudio上的线路混合在一起

这看起来像:

ffmpeg \
  -use_wallclock_as_timestamps 1  -fflags +genpts    \
  -max_delay 2000000 -thread_queue_size 1024         \
  -i "rtsp://url"           \
  -use_wallclock_as_timestamps 1  -fflags +genpts    \
  -max_delay 2000000 -thread_queue_size 1024         \
  -itsoffset <offset>       \
  -f pulse                  \
  [...]
延迟的原因是什么?如何消除延迟

因此,RTMP服务器本身不会造成明显的延迟 假设这是一个时间戳问题,但我的智慧以上述内容结束 书面选择权

ffmpeg -i rtsp://url -c copy -an -f flv rtmp://localhost/live

ffmpeg \
  -use_wallclock_as_timestamps 1  -fflags +genpts    \
  -max_delay 2000000 -thread_queue_size 1024         \
  -i "rtmp://localhost/live"                         \
  -use_wallclock_as_timestamps 1  -fflags +genpts    \
  -max_delay 2000000 -thread_queue_size 1024         \
  -itsoffset <offset>                                \
  -f pulse                                           \
  [...]
application live {
      live on;
      sync 10ms;
      record off;
      allow publish 127.0.0.1;
      deny publish all;
      }