Skip to content
New issue

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

RTSP: ffmpeg crashes and exits when streaming Hikvision RTSP video stream. #1849

Closed
tidehc opened this issue Jul 13, 2020 · 5 comments
Closed
Assignees
Labels
TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Milestone

Comments

@tidehc
Copy link

tidehc commented Jul 13, 2020

Description'

Please ensure that the markdown structure is maintained.

Please describe the issue you encountered here.
'
Make sure to maintain the markdown structure.

  1. SRS version: 3.0.141
  2. The log of SRS is as follows:
[2020-07-13 16:47:53.150][Trace][869][0] XCORE-SRS/3.0.141(OuXuli)
[2020-07-13 16:47:53.150][Trace][869][0] config parse complete
[2020-07-13 16:47:53.151][Trace][869][0] write log to console
[2020-07-13 16:47:53.151][Trace][869][0] SRS/3.0.141(OuXuli), The MIT License (MIT)
[2020-07-13 16:47:53.151][Trace][869][0] contributors: winlin<[email protected]> wenjie.zhao<[email protected]> xiangcheng.liu<[email protected]> naijia.liu<[email protected]> alcoholyi<[email protected]> byteman<[email protected]> chad.wang<[email protected]> suhetao<[email protected]> Johnny<[email protected]> karthikeyan<[email protected]> StevenLiu<[email protected]> zhengfl<[email protected]> tufang14<[email protected]> allspace<[email protected]> niesongsong<[email protected]> rudeb0t<[email protected]> CallMeNP<[email protected]> synote<[email protected]> lovecat<[email protected]> panda1986<[email protected]> YueHonghui<[email protected]> ThomasDreibholz<[email protected]> JuntaoLiu<[email protected]> RocFang<[email protected]> MakarovYaroslav<[email protected]> MirkoVelic<[email protected]> HuiZhang(huzhang2)<[email protected]> OtterWa<[email protected]> walkermi<[email protected]> haofz<[email protected]> ME_Kun_Han<[email protected]> ljx0305<[email protected]> cenxinwei<[email protected]> StarBrilliant<[email protected]> xubin<[email protected]> intliang<[email protected]> flowerwrong<[email protected]> YLX<[email protected]> J<[email protected]> Harlan<[email protected]> hankun<[email protected]> JonathanBarratt<[email protected]> KeeganH<[email protected]> StevenLiu<[email protected]> liuxc0116<[email protected]> ChengdongZhang<[email protected]> lovacat<[email protected]> qiang.li<[email protected]> HungMingWu<[email protected]> Himer<[email protected]> xialixin<[email protected]> alphonsetai<[email protected]> Michael.Ma<[email protected]> lam2003<[email protected]> l<[email protected]> xfalcon<[email protected]> 
[2020-07-13 16:47:53.151][Trace][869][0] cwd=/data/srs/trunk, work_dir=./, build: 2020-07-13 13:32:46, configure: --x86-x64 , uname: Linux webservice 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux, osx: 0
[2020-07-13 16:47:53.151][Trace][869][0] configure detail: --prefix=/usr/local/srs --with-hls --with-hds --with-dvr --with-ssl --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --with-stream-caster --with-http-api --with-librtmp --without-research --without-utest --without-gperf --without-gmc --without-gmd --without-gmp --without-gcp --without-gprof --log-trace --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib
[2020-07-13 16:47:53.151][Trace][869][0] srs checking config...
[2020-07-13 16:47:53.151][Trace][869][0] ips, iface[0] eth0 ipv4 0x11043 192.168.0.168, iface[1] eth1 ipv4 0x11043 192.168.0.172, iface[2] eth1 ipv6 0x11043 fe80::555e:e25f:3153:b7d91.451199e-316th1
[2020-07-13 16:47:53.151][Trace][869][0] devices, intranet eth0 192.168.0.168, intranet eth1 192.168.0.172, intranet eth1 fe80::555e:e25f:3153:b7d91.451199e-316th1
�[33m[2020-07-13 16:47:53.151][Warn][869][0][0] stats network use index=0, ip=192.168.0.168
�[0m�[33m[2020-07-13 16:47:53.151][Warn][869][0][0] stats disk not configed, disk iops disabled.
�[0m[2020-07-13 16:47:53.151][Trace][869][0] write log to console
[2020-07-13 16:47:53.151][Trace][869][0] features, rch:on, dash:on, hls:on, hds:on, hc:on, ha:on, hs:on, hp:on, dvr:on, trans:on, inge:on, stat:on, sc:on
[2020-07-13 16:47:53.151][Trace][869][0] SRS on  amd64 x86_64, conf:conf/push.rtsp.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100
[2020-07-13 16:47:53.151][Trace][869][0] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms
[2020-07-13 16:47:53.151][Trace][869][0] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write)
[2020-07-13 16:47:53.151][Trace][869][0] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000)
�[33m[2020-07-13 16:47:53.151][Warn][869][0][0] SRS/3.0.141 is beta
�[0m[2020-07-13 16:47:53.151][Trace][869][0] http: root mount to ./objs/nginx/html
[2020-07-13 16:47:53.151][Trace][869][0] st_init success, use epoll
[2020-07-13 16:47:53.151][Trace][869][676] server main cid=676, pid=869, ppid=1819, asprocess=0
[2020-07-13 16:47:53.151][Trace][869][676] write pid=869 to ./objs/srs.pid success!
[2020-07-13 16:47:53.151][Trace][869][676] RTMP listen at tcp://0.0.0.0:1935, fd=7
[2020-07-13 16:47:53.151][Trace][869][676] RTSP listen at tcp://0.0.0.0:554, fd=8
[2020-07-13 16:47:53.151][Trace][869][676] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3
[2020-07-13 16:47:53.151][Trace][869][676] http: api mount /console to ./objs/nginx/html/console
[2020-07-13 16:48:11.722][Trace][869][681] rtsp: serve 210.12.2.60
[2020-07-13 16:48:11.722][Trace][869][681] rtsp: ignore header User-Agent=Lavf58.24.101
[2020-07-13 16:48:11.750][Trace][869][681] rtsp: ignore header User-Agent=Lavf58.24.101
[2020-07-13 16:48:11.816][Trace][869][681] rtsp: video(#0, H265, RTP/AVP/96), audio(#1, , RTP/AVP/0, 0HZ 0channels), rtsp://zt.dtznjg.com:554/800519/1594609434301
[2020-07-13 16:48:11.845][Trace][869][681] rtsp: ignore header User-Agent=Lavf58.24.101
[2020-07-13 16:48:11.845][Trace][869][681] rtsp: #0 Video over RTP/AVP/TCP unicast client-port=0-0, server-port=57200-57201
srs: src/app/srs_app_st.cpp:146: virtual void SrsSTCoroutine::stop(): Assertion `!r0' failed.
Aborted

FFmpeg streaming log
ffmpeg -re -i rtsp://admin:[email protected]/Streaming/Channels/2 -vcodec copy -acodec copy -rtsp_transport tcp -f rtsp rtsp://zt.dtznjg.com:554/800519/1594609434301
ffmpeg version N-92722-gf22fcd4483 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181201
  configuration: --disable-static --enable-shared --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 --enable-libopenmpt
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 42.102 / 58. 42.102
  libavformat    58. 24.101 / 58. 24.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[udp @ 00000200a6543f40] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 00000200a6544000] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 00000200a6569540] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 00000200a6579840] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://admin:[email protected]/Streaming/Channels/2':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuvj420p(pc, bt709), 360x640, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
[rtsp @ 00000200a659c580] Nonmatching transport in server reply
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
    Last message repeated 1 times

  1. The configuration of SRS is as follows (Config):
The built-in configuration file is conf/push.rtsp.conf.

# push MPEG-TS over UDP to SRS.
# @see https://github.com/ossrs/srs/wiki/v2_CN_Streamer#push-mpeg-ts-over-udp
# @see https://github.com/ossrs/srs/issues/250#issuecomment-72321769
# @see full.conf for detail config.

listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;
stream_caster {
    enabled         on;
    caster          rtsp;
    output          rtmp://127.0.0.1/[app]/[stream];
    listen          554;
    rtp_port_min    57200;
    rtp_port_max    57300;
}
vhost __defaultVhost__ {
}

Replay

How to replay bug?

Steps to reproduce the bug

Error occurred when pushing Hikvision camera's H.265 RTSP video stream to the server using ffmpeg.

Command line:
ffmpeg -re -i rtsp://admin:[email protected]/Streaming/Channels/2 -vcodec copy -acodec copy -rtsp_transport tcp -f rtsp rtsp://zt.dtznjg.com:554/800519/1594609434301

Expected behavior (Expect)

> Describe your expectation (Please describe your expectation)

rtsp streaming is not available, is it a problem with ffmpeg265 or srs?

TRANS_BY_GPT3

@MyKays
Copy link

MyKays commented Jul 16, 2020

Brother, is it resolved? I am also doing RTSP streaming, but encountering errors when pushing it up.

TRANS_BY_GPT3

@xialixin
Copy link
Contributor

xialixin commented Jul 21, 2020

Does not support rtsp h265, h264 push streaming this problem, 4.0 has a solution, please see this #1612.

TRANS_BY_GPT3

@tidehc
Copy link
Author

tidehc commented Jul 21, 2020

Still on version 4.0, just that the server won't crash.
SRS 4.0 log:
[2020-07-21 16:21:39.357][Trace][12746][540] rtsp: serve 210.12.2.60:52858
[2020-07-21 16:21:39.357][Trace][12746][540] rtsp: ignore header User-Agent=Lavf58.24.101
[2020-07-21 16:21:39.383][Trace][12746][540] rtsp: ignore header User-Agent=Lavf58.24.101
[2020-07-21 16:21:39.449][Trace][12746][540] rtsp: video(#0, H265, RTP/AVP/96), audio(#1, , RTP/AVP/8, 0HZ 0channels), rtsp://zt.dtznjg.com:554/800519/1594609434301
[2020-07-21 16:21:39.474][Trace][12746][540] rtsp: ignore header User-Agent=Lavf58.24.101
[2020-07-21 16:21:39.474][Trace][12746][540] rtsp: rtsp alloc port=57200-57201
[2020-07-21 16:21:39.474][Trace][12746][540] UDP #10 LISTEN at 0.0.0.0:57200, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0)
[2020-07-21 16:21:39.474][Trace][12746][540] rtsp: #0 Video over RTP/AVP/TCP unicast client-port=0-0, server-port=57200-57201
[2020-07-21 16:21:39.502][Warn][12746][540][104] client disconnect peer. code=1007
[2020-07-21 16:21:39.502][Trace][12746][540] rtsp: rtsp free rtp port=57200-57201

The ffmpeg streaming is the same as before.
Nonmatching transport in server reply
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input

TRANS_BY_GPT3

@qingniang
Copy link

qingniang commented Jul 30, 2020

Bro, have you solved this problem? I encountered the same issue as you, can we discuss it?


SRS 4.0.35, the log is as follows:
[2020-07-30 16:07:22.242][Trace][32076][14dy280q] rtsp: serve 192.168.32.128:48646
[2020-07-30 16:07:22.242][Trace][32076][14dy280q] rtsp: ignore header User-Agent=Lavf58.29.100
[2020-07-30 16:07:22.242][Trace][32076][14dy280q] rtsp: ignore header User-Agent=Lavf58.29.100
[2020-07-30 16:07:22.284][Trace][32076][14dy280q] rtsp: video(#0, MP4V-ES, RTP/AVP/96), audio(#0, , /, 0HZ 0channels), rtsp://192.168.32.129:554/live/test
[2020-07-30 16:07:22.284][Trace][32076][14dy280q] rtsp: ignore header User-Agent=Lavf58.29.100
[2020-07-30 16:07:22.284][Trace][32076][14dy280q] rtsp: rtsp alloc port=57200-57201
[2020-07-30 16:07:22.285][Trace][32076][14dy280q] UDP #10 LISTEN at 0.0.0.0:57200, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0)
[2020-07-30 16:07:22.285][Trace][32076][14dy280q] rtsp: #0 Video over RTP/AVP/TCP unicast client-port=0-0, server-port=57200-57201
[2020-07-30 16:07:22.285][Warn][32076][14dy280q][104] client disconnect peer. code=1007
[2020-07-30 16:07:22.285][Trace][32076][14dy280q] rtsp: rtsp free rtp port=57200-57201

FFmpeg log:
Input #0, mpeg, from 'test.mp4':
Duration: 00:00:40.45, start: 4.273000, bitrate: 5769 kb/s
Stream #0:0[0x1e0]: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 2560x1536, 2 fps, 25.08 tbr, 90k tbn, 4 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[swscaler @ 0x55f25c4f96c0] deprecated pixel format used, make sure you did set range correctly
[rtsp @ 0x55f25b85b600] Nonmatching transport in server reply
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input
Error initializing output stream 0:0 --
Conversion failed!

Streaming command: [ffmpeg -re -i test.mp4 -f rtsp -rtsp_transport tcp rtsp://192.168.32.129/live/test.sdp]

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Sep 2, 2021

In actual scenarios, there is no need to promote RTSP, so the RTSP server will be removed in the future.

The camera does not support pushing RTSP streams to SRS. It only supports Ingest/FFmpeg to pull RTSP streams from the camera and then forward them to SRS. Please refer to: #2304 (comment)

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Sep 2, 2021
@winlinvip winlinvip added the Won't fix We won't fix it. label Sep 2, 2021
@winlinvip winlinvip added this to the 4.0 milestone Sep 4, 2021
@winlinvip winlinvip changed the title ffmpeg推流海康h.265的rtsp视频流时崩溃退出 ffmpeg推流海康rtsp视频流时崩溃退出 Nov 22, 2022
@winlinvip winlinvip changed the title ffmpeg推流海康rtsp视频流时崩溃退出 RTSP: ffmpeg推流海康rtsp视频流时崩溃退出 Nov 22, 2022
@winlinvip winlinvip changed the title RTSP: ffmpeg推流海康rtsp视频流时崩溃退出 RTSP: ffmpeg crashes and exits when streaming Hikvision RTSP video stream. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Projects
None yet
Development

No branches or pull requests

5 participants