Opened 9 months ago

Closed 8 months ago

#6218 closed defect (invalid)

FFMpeg RTSP to .m3u8 conversion

Reported by: ankit.gupta Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Using FFMpeg to convert RTSP to .m3u8 using below command

ffmpeg -i rtsp://root:kastle@192.168.17.153/axis-media/media.amp -r 100 -crf 25 -preset faster -maxrate 500k -bufsize 1500k -c:v libx264 -hls_time 4 -hls_list_size 2 -hls_wrap 2 -start_number 1 -tsp_transport tcp -y Z:/playlist.m3u8

For one of the camera in same network this command works well. For another camera there is frequent error with message
"max delay reached, need to consume packet
RTP missed 10 packets"

Below is the console output, that I cancelled in between

[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 24 packets
[h264 @ 000000000039cae0] error while decoding MB 35 27, bytestream -40
[h264 @ 000000000039cae0] concealing 590 DC, 590 AC, 590 MV errors in I frame
Input #0, rtsp, from 'rtsp://root:kastle@192.168.17.153/axis-media/media.amp':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server

Duration: N/A, start: 0.100133, bitrate: N/A

Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1024x576

[SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 000000000055efc0] using SAR=1/1
[libx264 @ 000000000055efc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 000000000055efc0] profile High, level 4.0
Output #0, hls, to 'Z:/playlist.m3u8':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (libx264), yuvj420p(pc), 1024x576 [SAR 1:1 DAR 16:9

], q=-1--1, 100 fps, 90k tbn, 100 tbc

Metadata:

encoder : Lavc57.64.101 libx264

Side data:

cpb: bitrate max/min/avg: 500000/0/0 buffer size: 1500000 vbv_delay: -1

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

Press [q] to stop, ? for help
[h264 @ 00000000028f4240] error while decoding MB 35 27, bytestream -40
[h264 @ 00000000028f4240] concealing 590 DC, 590 AC, 590 MV errors in I frame
frame= 38 fps=0.0 q=35.0 size=N/A time=00:00:00.14 bitrate=N/A dup=25 drop=0 s
frame= 71 fps= 68 q=35.0 size=N/A time=00:00:00.47 bitrate=N/A dup=48 drop=0 s
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 111 packets
[h264 @ 00000000028f4240] error while decoding MB 31 28, bytestream -7
[h264 @ 00000000028f4240] concealing 530 DC, 530 AC, 530 MV errors in I frame
frame= 188 fps= 67 q=35.0 size=N/A time=00:00:01.64 bitrate=N/A dup=161 drop=0
frame= 225 fps= 68 q=35.0 size=N/A time=00:00:02.01 bitrate=N/A dup=187 drop=0
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 122 packets
[h264 @ 00000000028f4240] error while decoding MB 41 26, bytestream -15
[h264 @ 00000000028f4240] concealing 648 DC, 648 AC, 648 MV errors in I frame
frame= 248 fps= 64 q=35.0 size=N/A time=00:00:02.24 bitrate=N/A dup=203 drop=0
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 1 packets
frame= 388 fps= 50 q=35.0 size=N/A time=00:00:03.64 bitrate=N/A dup=340 drop=0
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 1 packets
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 1 packets
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 1 packets
frame= 411 fps= 49 q=35.0 size=N/A time=00:00:03.87 bitrate=N/A dup=358 drop=0
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 66 packets
[h264 @ 00000000028f4240] error while decoding MB 12 1, bytestream -27
[h264 @ 00000000028f4240] concealing 2277 DC, 2277 AC, 2277 MV errors in I frame

[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 1 packets
frame= 445 fps= 48 q=35.0 size=N/A time=00:00:04.21 bitrate=N/A dup=387 drop=0
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 4 packets
frame= 472 fps= 47 q=35.0 size=N/A time=00:00:04.48 bitrate=N/A dup=410 drop=0
frame= 492 fps= 46 q=35.0 size=N/A time=00:00:04.68 bitrate=N/A dup=424 drop=0
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 576 packets
[h264 @ 00000000028f4240] error while decoding MB 54 26, bytestream -40
[h264 @ 00000000028f4240] concealing 635 DC, 635 AC, 635 MV errors in I frame
frame= 512 fps= 46 q=35.0 size=N/A time=00:00:04.88 bitrate=N/A dup=438 drop=0
[rtsp @ 00000000004e0480] max delay reached. need to consume packet
[rtsp @ 00000000004e0480] RTP: missed 1 packets
frame= 1109 fps= 44 q=35.0 Lsize=N/A time=00:00:11.06 bitrate=N/A dup=1034 drop=
0 speed=0.434x
video:380kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing o
verhead: unknown
[libx264 @ 000000000055efc0] frame I:5 Avg QP:22.54 size: 63740
[libx264 @ 000000000055efc0] frame P:279 Avg QP:31.95 size: 173
[libx264 @ 000000000055efc0] frame B:825 Avg QP:41.15 size: 27
[libx264 @ 000000000055efc0] consecutive B-frames: 0.7% 0.2% 0.3% 98.8%
[libx264 @ 000000000055efc0] mb I I16..4: 29.7% 33.1% 37.2%
[libx264 @ 000000000055efc0] mb P I16..4: 0.1% 0.0% 0.0% P16..4: 1.1% 0.1
% 0.0% 0.0% 0.0% skip:98.7%
[libx264 @ 000000000055efc0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.0% 0.0
% 0.0% direct: 0.0% skip:100.0% L0:32.1% L1:67.9% BI: 0.0%
[libx264 @ 000000000055efc0] 8x8 transform intra:33.4% inter:12.7%
[libx264 @ 000000000055efc0] coded y,uvDC,uvAC intra: 59.4% 35.8% 10.1% inter: 0
.1% 0.1% 0.0%
[libx264 @ 000000000055efc0] i16 v,h,dc,p: 51% 12% 31% 6%
[libx264 @ 000000000055efc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 53% 15% 16% 2% 0%

1% 1% 2% 11%

[libx264 @ 000000000055efc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 10% 18% 5% 2%

4% 3% 3% 38%

[libx264 @ 000000000055efc0] i8c dc,h,v,p: 61% 11% 27% 2%
[libx264 @ 000000000055efc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 000000000055efc0] ref P L0: 83.4% 16.6%
[libx264 @ 000000000055efc0] ref B L0: 92.4% 7.6%
[libx264 @ 000000000055efc0] ref B L1: 95.6% 4.4%
[libx264 @ 000000000055efc0] kb/s:281.02
Exiting normally, received signal 2.

Change History (9)

comment:1 Changed 9 months ago by stevenliu

try commandline:

ffmpeg -rtsp_transport tcp -i rtsp://root:kastle@192.168.17.153/axis-media/media.amp -r 100 -crf 25 -preset faster -maxrate 500k -bufsize 1500k -c:v libx264 -hls_time 4 -hls_list_size 2 -hls_wrap 2 -start_number 1 -tsp_transport tcp -y Z:/playlist.m3u8

comment:2 Changed 9 months ago by ankit.gupta

This is the fastest response I have ever seen for any open source. Thank you it worked.

Please excuse me as I am first time explorer of FFMpeg. One thing I believe there is some typo in command for _tsp_transport tcp, i tried following command instead, am i right

ffmpeg -rtsp_transport tcp -i rtsp://root:kastle@192.168.17.153/axis-media/media.amp -r 100 -crf 25 -preset faster -maxrate 500k -bufsize 1500k -c:v libx264 -hls_time 4 -hls_list_size 2 -hls_wrap 2 -start_number 1 -y Z:/playlist.m3u8

comment:3 Changed 9 months ago by ankit.gupta

This command stopped after few minutes and one error I am seeing in the end, see console output

C:\Users\sunil\Downloads\ffmpeg-3.2.2-win64-static\ffmpeg-3.2.2-win64-static\bin

ffmpeg -rtsp_transport tcp -i rtsp://root:kastle@192.168.17.153/axis-media/medi

a.amp -r 100 -crf 25 -preset faster -maxrate 500k -bufsize 1500k -c:v libx264 -h
ls_time 4 -hls_list_size 2 -hls_wrap 2 -start_number 1 -y Z:/playlist.m3u8
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers

built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx -

-enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei
0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-li
bbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --en
able-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-li
bopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --e
nable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable
-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --e
nable-lzma --enable-decklink --enable-zlib

libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100

Input #0, rtsp, from 'rtsp://root:kastle@192.168.17.153/axis-media/media.amp':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server

Duration: N/A, start: 0.033378, bitrate: N/A

Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1024x576

[SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 00000000005ef660] using SAR=1/1
[libx264 @ 00000000005ef660] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 00000000005ef660] profile High, level 4.0
Output #0, hls, to 'Z:/playlist.m3u8':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (libx264), yuvj420p(pc), 1024x576 [SAR 1:1 DAR 16:9

], q=-1--1, 100 fps, 90k tbn, 100 tbc

Metadata:

encoder : Lavc57.64.101 libx264

Side data:

cpb: bitrate max/min/avg: 500000/0/0 buffer size: 1500000 vbv_delay: -1

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

Press [q] to stop, ? for help
frame= 34 fps=0.0 q=35.0 size=N/A time=00:00:00.10 bitrate=N/A dup=22 drop=0 s
frame= 58 fps= 57 q=35.0 size=N/A time=00:00:00.34 bitrate=N/A dup=39 drop=0 s
frame= 78 fps= 51 q=35.0 size=N/A time=00:00:00.54 bitrate=N/A dup=53 drop=0 s
frame= 101 fps= 49 q=35.0 size=N/A time=00:00:00.77 bitrate=N/A dup=69 drop=0 s
frame= 121 fps= 47 q=35.0 size=N/A time=00:00:00.97 bitrate=N/A dup=83 drop=0 s
frame= 148 fps= 47 q=35.0 size=N/A time=00:00:01.24 bitrate=N/A dup=102 drop=0
frame= 178 fps= 47 q=35.0 size=N/A time=00:00:01.54 bitrate=N/A dup=123 drop=0
frame= 201 fps= 46 q=35.0 size=N/A time=00:00:01.77 bitrate=N/A dup=139 drop=0
frame= 218 fps= 44 q=35.0 size=N/A time=00:00:01.94 bitrate=N/A dup=151 drop=0
frame= 241 fps= 44 q=35.0 size=N/A time=00:00:02.17 bitrate=N/A dup=167 drop=0
frame= 258 fps= 42 q=35.0 size=N/A time=00:00:02.34 bitrate=N/A dup=179 drop=0
frame= 275 fps= 41 q=35.0 size=N/A time=00:00:02.51 bitrate=N/A dup=191 drop=0
frame= 295 fps= 40 q=35.0 size=N/A time=00:00:02.71 bitrate=N/A dup=205 drop=0
frame= 315 fps= 40 q=35.0 size=N/A time=00:00:02.91 bitrate=N/A dup=219 drop=0
frame= 335 fps= 40 q=35.0 size=N/A time=00:00:03.11 bitrate=N/A dup=233 drop=0
frame= 355 fps= 40 q=35.0 size=N/A time=00:00:03.31 bitrate=N/A dup=247 drop=0
frame= 375 fps= 39 q=35.0 size=N/A time=00:00:03.51 bitrate=N/A dup=261 drop=0
frame= 388 fps= 38 q=35.0 size=N/A time=00:00:03.64 bitrate=N/A dup=270 drop=0
frame= 408 fps= 38 q=35.0 size=N/A time=00:00:03.84 bitrate=N/A dup=284 drop=0
frame= 432 fps= 38 q=35.0 size=N/A time=00:00:04.08 bitrate=N/A dup=301 drop=0
frame= 455 fps= 38 q=35.0 size=N/A time=00:00:04.31 bitrate=N/A dup=317 drop=0
frame= 478 fps= 38 q=35.0 size=N/A time=00:00:04.54 bitrate=N/A dup=333 drop=0
frame= 505 fps= 39 q=35.0 size=N/A time=00:00:04.81 bitrate=N/A dup=352 drop=0
frame= 525 fps= 38 q=35.0 size=N/A time=00:00:05.01 bitrate=N/A dup=366 drop=0
frame= 545 fps= 38 q=35.0 size=N/A time=00:00:05.21 bitrate=N/A dup=380 drop=0
frame= 568 fps= 38 q=35.0 size=N/A time=00:00:05.44 bitrate=N/A dup=396 drop=0
frame= 592 fps= 38 q=35.0 size=N/A time=00:00:05.68 bitrate=N/A dup=413 drop=0
frame= 615 fps= 39 q=35.0 size=N/A time=00:00:05.91 bitrate=N/A dup=429 drop=0
frame= 635 fps= 39 q=35.0 size=N/A time=00:00:06.11 bitrate=N/A dup=443 drop=0
frame= 658 fps= 39 q=35.0 size=N/A time=00:00:06.34 bitrate=N/A dup=459 drop=0
frame= 685 fps= 39 q=35.0 size=N/A time=00:00:06.61 bitrate=N/A dup=478 drop=0
frame= 869 fps= 40 q=35.0 size=N/A time=00:00:08.45 bitrate=N/A dup=658 drop=0
frame= 892 fps= 40 q=35.0 size=N/A time=00:00:08.68 bitrate=N/A dup=674 drop=0
frame= 919 fps= 40 q=35.0 size=N/A time=00:00:08.95 bitrate=N/A dup=693 drop=0
frame= 1386 fps= 59 q=35.0 size=N/A time=00:00:13.62 bitrate=N/A dup=1149 drop=0
frame= 1389 fps= 41 q=35.0 size=N/A time=00:00:13.65 bitrate=N/A dup=1151 drop=0
frame= 1426 fps= 42 q=35.0 size=N/A time=00:00:14.02 bitrate=N/A dup=1177 drop=0
frame= 1459 fps= 42 q=35.0 size=N/A time=00:00:14.35 bitrate=N/A dup=1200 drop=0
frame= 1823 fps= 43 q=35.0 size=N/A time=00:00:17.99 bitrate=N/A dup=1558 drop=0
frame= 1840 fps= 43 q=35.0 size=N/A time=00:00:18.16 bitrate=N/A dup=1570 drop=0
frame= 1863 fps= 43 q=35.0 size=N/A time=00:00:18.39 bitrate=N/A dup=1586 drop=0
frame= 1887 fps= 43 q=35.0 size=N/A time=00:00:18.63 bitrate=N/A dup=1603 drop=0
frame= 1907 fps= 43 q=35.0 size=N/A time=00:00:18.83 bitrate=N/A dup=1617 drop=0
frame= 1930 fps= 43 q=35.0 size=N/A time=00:00:19.06 bitrate=N/A dup=1633 drop=0
frame= 1953 fps= 43 q=35.0 size=N/A time=00:00:19.29 bitrate=N/A dup=1649 drop=0
frame= 1990 fps= 43 q=35.0 size=N/A time=00:00:19.66 bitrate=N/A dup=1675 drop=0
frame= 2431 fps= 43 q=35.0 size=N/A time=00:00:24.07 bitrate=N/A dup=2113 drop=0
frame= 2467 fps= 43 q=35.0 size=N/A time=00:00:24.43 bitrate=N/A dup=2138 drop=0
frame= 2504 fps= 44 q=35.0 size=N/A time=00:00:24.80 bitrate=N/A dup=2164 drop=0
frame= 3555 fps= 48 q=35.0 size=N/A time=00:00:35.31 bitrate=N/A dup=3210 drop=0
frame= 3559 fps= 45 q=35.0 size=N/A time=00:00:35.35 bitrate=N/A dup=3213 drop=0
frame= 3582 fps= 45 q=35.0 size=N/A time=00:00:35.58 bitrate=N/A dup=3229 drop=0
frame= 3612 fps= 45 q=35.0 size=N/A time=00:00:35.88 bitrate=N/A dup=3250 drop=0
frame= 3639 fps= 45 q=35.0 size=N/A time=00:00:36.15 bitrate=N/A dup=3269 drop=0
frame= 4687 fps= 46 q=35.0 size=N/A time=00:00:46.63 bitrate=N/A dup=4314 drop=0
frame= 4720 fps= 46 q=35.0 size=N/A time=00:00:46.96 bitrate=N/A dup=4337 drop=0
frame= 4757 fps= 46 q=35.0 size=N/A time=00:00:47.33 bitrate=N/A dup=4363 drop=0
frame= 5815 fps= 46 q=35.0 size=N/A time=00:00:57.91 bitrate=N/A dup=5415 drop=0
frame= 5851 fps= 46 q=35.0 size=N/A time=00:00:58.27 bitrate=N/A dup=5440 drop=0
frame= 5888 fps= 46 q=35.0 size=N/A time=00:00:58.64 bitrate=N/A dup=5466 drop=0
[rtsp @ 0000000000420480] CSeq 8 expected, 7 received.
[rtsp @ 0000000000420480] CSeq 9 expected, 8 received.
frame= 8067 fps= 51 q=35.0 size=N/A time=00:01:20.43 bitrate=N/A dup=7640 drop=0
frame= 8154 fps= 48 q=35.0 size=N/A time=00:01:21.30 bitrate=N/A dup=7726 drop=0
frame=10410 fps= 60 q=35.0 size=N/A time=00:01:43.86 bitrate=N/A dup=9981 drop=0
[rtsp @ 0000000000420480] CSeq 10 expected, 9 received.
frame=12753 fps= 58 q=35.0 size=N/A time=00:02:07.29 bitrate=N/A dup=12323 drop=
frame=15963 fps= 60 q=35.0 size=N/A time=00:02:39.39 bitrate=N/A dup=15532 drop=
frame=15967 fps= 48 q=35.0 size=N/A time=00:02:39.43 bitrate=N/A dup=15535 drop=
frame=16000 fps= 48 q=35.0 size=N/A time=00:02:39.76 bitrate=N/A dup=15558 drop=
[h264 @ 0000000002b53b40] error while decoding MB 34 18, bytestream -3
[h264 @ 0000000002b53b40] concealing 1167 DC, 1167 AC, 1167 MV errors in I frame

av_interleaved_write_frame(): Immediate exit requested

Received > 3 system signals, hard exiting

C:\Users\sunil\Downloads\ffmpeg-3.2.2-win64-static\ffmpeg-3.2.2-win64-static\bin

ffmpeg -rtsp_transport tcp -i rtsp://root:kastle@192.168.17.153/axis-media/medi

a.amp -r 100 -crf 25 -preset faster -maxrate 500k -bufsize 1500k -c:v libx264 -h
ls_time 4 -hls_list_size 2 -hls_wrap 2 -start_number 1 -rtsp_transport tcp -y Z:
/playlist.m3u8
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers

built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx -

-enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei
0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-li
bbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --en
able-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-li
bopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --e
nable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable
-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --e
nable-lzma --enable-decklink --enable-zlib

libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100

Input #0, rtsp, from 'rtsp://root:kastle@192.168.17.153/axis-media/media.amp':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server

Duration: N/A, start: 0.033378, bitrate: N/A

Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1024x576

[SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0000000002650540] using SAR=1/1
[libx264 @ 0000000002650540] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0000000002650540] profile High, level 4.0
Output #0, hls, to 'Z:/playlist.m3u8':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (libx264), yuvj420p(pc), 1024x576 [SAR 1:1 DAR 16:9

], q=-1--1, 100 fps, 90k tbn, 100 tbc

Metadata:

encoder : Lavc57.64.101 libx264

Side data:

cpb: bitrate max/min/avg: 500000/0/0 buffer size: 1500000 vbv_delay: -1

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

Press [q] to stop, ? for help
frame= 41 fps=0.0 q=35.0 size=N/A time=00:00:00.17 bitrate=N/A dup=27 drop=0 s
frame= 58 fps= 57 q=35.0 size=N/A time=00:00:00.34 bitrate=N/A dup=39 drop=0 s
frame= 81 fps= 51 q=35.0 size=N/A time=00:00:00.57 bitrate=N/A dup=55 drop=0 s
frame= 101 fps= 46 q=35.0 size=N/A time=00:00:00.77 bitrate=N/A dup=69 drop=0 s
frame= 121 fps= 44 q=35.0 size=N/A time=00:00:00.97 bitrate=N/A dup=83 drop=0 s
frame= 138 fps= 43 q=35.0 size=N/A time=00:00:01.14 bitrate=N/A dup=95 drop=0 s
frame= 168 fps= 45 q=35.0 size=N/A time=00:00:01.44 bitrate=N/A dup=116 drop=0
frame= 201 fps= 47 q=35.0 size=N/A time=00:00:01.77 bitrate=N/A dup=139 drop=0
frame= 238 fps= 50 q=35.0 size=N/A time=00:00:02.14 bitrate=N/A dup=165 drop=0
frame= 258 fps= 49 q=35.0 size=N/A time=00:00:02.34 bitrate=N/A dup=179 drop=0
frame= 278 fps= 46 q=35.0 size=N/A time=00:00:02.54 bitrate=N/A dup=193 drop=0
frame= 298 fps= 45 q=35.0 size=N/A time=00:00:02.74 bitrate=N/A dup=207 drop=0
frame= 315 fps= 44 q=35.0 size=N/A time=00:00:02.91 bitrate=N/A dup=219 drop=0
frame= 338 fps= 44 q=35.0 size=N/A time=00:00:03.14 bitrate=N/A dup=235 drop=0
frame= 435 fps= 41 q=35.0 size=N/A time=00:00:04.11 bitrate=N/A dup=328 drop=0
frame= 455 fps= 41 q=35.0 size=N/A time=00:00:04.31 bitrate=N/A dup=342 drop=0
frame= 475 fps= 41 q=35.0 size=N/A time=00:00:04.51 bitrate=N/A dup=356 drop=0
frame= 498 fps= 41 q=35.0 size=N/A time=00:00:04.74 bitrate=N/A dup=372 drop=0
frame= 518 fps= 41 q=35.0 size=N/A time=00:00:04.94 bitrate=N/A dup=386 drop=0
frame= 535 fps= 40 q=35.0 size=N/A time=00:00:05.11 bitrate=N/A dup=398 drop=0
frame= 572 fps= 41 q=35.0 size=N/A time=00:00:05.48 bitrate=N/A dup=424 drop=0
frame= 605 fps= 42 q=35.0 size=N/A time=00:00:05.81 bitrate=N/A dup=447 drop=0
frame= 642 fps= 43 q=35.0 size=N/A time=00:00:06.18 bitrate=N/A dup=473 drop=0
frame= 678 fps= 44 q=35.0 size=N/A time=00:00:06.54 bitrate=N/A dup=498 drop=0
frame= 865 fps= 51 q=35.0 size=N/A time=00:00:08.41 bitrate=N/A dup=679 drop=0
frame= 869 fps= 45 q=35.0 size=N/A time=00:00:08.45 bitrate=N/A dup=682 drop=0
frame= 889 fps= 45 q=35.0 size=N/A time=00:00:08.65 bitrate=N/A dup=696 drop=0
frame= 909 fps= 45 q=35.0 size=N/A time=00:00:08.85 bitrate=N/A dup=710 drop=0
frame= 929 fps= 44 q=35.0 size=N/A time=00:00:09.05 bitrate=N/A dup=724 drop=0
frame= 952 fps= 44 q=35.0 size=N/A time=00:00:09.28 bitrate=N/A dup=740 drop=0
frame= 1476 fps= 47 q=35.0 size=N/A time=00:00:14.52 bitrate=N/A dup=1262 drop=0
frame= 1496 fps= 47 q=35.0 size=N/A time=00:00:14.72 bitrate=N/A dup=1276 drop=0
frame= 1516 fps= 47 q=35.0 size=N/A time=00:00:14.92 bitrate=N/A dup=1290 drop=0
frame= 1536 fps= 46 q=35.0 size=N/A time=00:00:15.12 bitrate=N/A dup=1304 drop=0
frame= 1560 fps= 46 q=35.0 size=N/A time=00:00:15.36 bitrate=N/A dup=1321 drop=0
frame= 1583 fps= 46 q=35.0 size=N/A time=00:00:15.59 bitrate=N/A dup=1337 drop=0
frame= 1610 fps= 46 q=35.0 size=N/A time=00:00:15.86 bitrate=N/A dup=1356 drop=0
frame= 1633 fps= 46 q=35.0 size=N/A time=00:00:16.09 bitrate=N/A dup=1372 drop=0
frame= 1650 fps= 45 q=35.0 size=N/A time=00:00:16.26 bitrate=N/A dup=1384 drop=0
frame= 1673 fps= 45 q=35.0 size=N/A time=00:00:16.49 bitrate=N/A dup=1400 drop=0
frame= 1690 fps= 45 q=35.0 size=N/A time=00:00:16.66 bitrate=N/A dup=1412 drop=0
frame= 1713 fps= 45 q=35.0 size=N/A time=00:00:16.89 bitrate=N/A dup=1428 drop=0
frame= 1733 fps= 45 q=35.0 size=N/A time=00:00:17.09 bitrate=N/A dup=1442 drop=0
frame= 2170 fps= 41 q=35.0 size=N/A time=00:00:21.46 bitrate=N/A dup=1877 drop=0
frame= 2194 fps= 41 q=35.0 size=N/A time=00:00:21.70 bitrate=N/A dup=1894 drop=0
frame= 2224 fps= 41 q=35.0 size=N/A time=00:00:22.00 bitrate=N/A dup=1915 drop=0
frame= 3208 fps= 59 q=35.0 size=N/A time=00:00:31.84 bitrate=N/A dup=2889 drop=0
frame= 3555 fps= 47 q=35.0 size=N/A time=00:00:35.31 bitrate=N/A dup=3235 drop=0
frame= 3559 fps= 42 q=35.0 size=N/A time=00:00:35.35 bitrate=N/A dup=3238 drop=0
frame= 3579 fps= 42 q=35.0 size=N/A time=00:00:35.55 bitrate=N/A dup=3252 drop=0
frame= 3902 fps= 46 q=35.0 size=N/A time=00:00:38.78 bitrate=N/A dup=3567 drop=0
frame= 5464 fps= 58 q=35.0 size=N/A time=00:00:54.40 bitrate=N/A dup=5128 drop=0
frame= 5468 fps= 42 q=35.0 size=N/A time=00:00:54.44 bitrate=N/A dup=5131 drop=0
frame= 5491 fps= 42 q=35.0 size=N/A time=00:00:54.67 bitrate=N/A dup=5147 drop=0
frame= 5511 fps= 42 q=35.0 size=N/A time=00:00:54.87 bitrate=N/A dup=5161 drop=0
frame= 5534 fps= 42 q=35.0 size=N/A time=00:00:55.10 bitrate=N/A dup=5177 drop=0
[rtsp @ 00000000004d0560] CSeq 8 expected, 7 received.
frame= 8588 fps= 49 q=35.0 size=N/A time=00:01:25.64 bitrate=N/A dup=8224 drop=0
frame=13187 fps= 65 q=35.0 size=N/A time=00:02:11.63 bitrate=N/A dup=12822 drop=
frame=13360 fps= 44 q=35.0 size=N/A time=00:02:13.36 bitrate=N/A dup=12994 drop=
frame=13364 fps= 43 q=35.0 size=N/A time=00:02:13.40 bitrate=N/A dup=12997 drop=
frame=13387 fps= 43 q=35.0 size=N/A time=00:02:13.63 bitrate=N/A dup=13013 drop=
frame=13407 fps= 43 q=35.0 size=N/A time=00:02:13.83 bitrate=N/A dup=13027 drop=
frame=13430 fps= 43 q=35.0 size=N/A time=00:02:14.06 bitrate=N/A dup=13043 drop=
[rtsp @ 00000000004d0560] CSeq 10 expected, 9 received.

comment:4 Changed 9 months ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Priority changed from critical to normal

comment:5 Changed 9 months ago by stevenliu

ffmpeg -rtsp_transport tcp -i rtsp://root:kastle@192.168.17.153/axis-media/media.amp -vcodec copy -hls_time 4 -hls_list_size 2 -hls_wrap 2 -start_number 1 -y Z:/playlist.m3u8

Do not transcode and try it

comment:6 follow-up: Changed 9 months ago by ankit.gupta

this command failed with below console output

C:\Users\sunil\Downloads\ffmpeg-3.2.2-win64-static - Copy\ffmpeg-3.2.2-win64-sta
tic\bin>ffmpeg -rtsp_transport tcp -i rtsp://root:kastle@192.168.17.153/axis-med
ia/media.amp -vcodec copy -hls_time 4 -hls_list_size 2 -hls_wrap 2 -start_number

1 -y Z:/playlist.m3u8

ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers

built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx -

-enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei
0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-li
bbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --en
able-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-li
bopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --e
nable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable
-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --e
nable-lzma --enable-decklink --enable-zlib

libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100

Input #0, rtsp, from 'rtsp://root:kastle@192.168.17.153/axis-media/media.amp':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server

Duration: N/A, start: 0.033389, bitrate: N/A

Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1024x576

[SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
Output #0, hls, to 'Z:/playlist.m3u8':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1024x576

[SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
Stream mapping:

Stream #0:0 -> #0:0 (copy)

Press [q] to stop, ? for help
[hls @ 00000000002fd7c0] Timestamps are unset in a packet for stream 0. This is
deprecated and will stop working in the future. Fix your code to set the timesta
mps properly
[mpegts @ 00000000002fc780] Timestamps are unset in a packet for stream 0. This
is deprecated and will stop working in the future. Fix your code to set the time
stamps properly
[mpegts @ 00000000002fc780] first pts value must be set
av_interleaved_write_frame(): Invalid data found when processing input
frame= 1 fps=0.0 q=-1.0 Lsize=N/A time=-00:00:00.03 bitrate=N/A speed=N/A

video:59kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
erhead: unknown
Conversion failed!

C:\Users\sunil\Downloads\ffmpeg-3.2.2-win64-static - Copy\ffmpeg-3.2.2-win64-sta
tic\bin>

comment:7 in reply to: ↑ 6 Changed 9 months ago by stevenliu

Replying to ankit.gupta:

this command failed with below console output

C:\Users\sunil\Downloads\ffmpeg-3.2.2-win64-static - Copy\ffmpeg-3.2.2-win64-sta
tic\bin>ffmpeg -rtsp_transport tcp -i rtsp://root:kastle@192.168.17.153/axis-med
ia/media.amp -vcodec copy -hls_time 4 -hls_list_size 2 -hls_wrap 2 -start_number

1 -y Z:/playlist.m3u8

ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers

built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx -

-enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei
0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-li
bbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --en
able-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-li
bopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --e
nable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable
-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --e
nable-lzma --enable-decklink --enable-zlib

libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100

Input #0, rtsp, from 'rtsp://root:kastle@192.168.17.153/axis-media/media.amp':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server

Duration: N/A, start: 0.033389, bitrate: N/A

Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1024x576

[SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
Output #0, hls, to 'Z:/playlist.m3u8':

Metadata:

title : Session streamed with GStreamer
comment : rtsp-server
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1024x576

[SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
Stream mapping:

Stream #0:0 -> #0:0 (copy)

Press [q] to stop, ? for help
[hls @ 00000000002fd7c0] Timestamps are unset in a packet for stream 0. This is
deprecated and will stop working in the future. Fix your code to set the timesta
mps properly
[mpegts @ 00000000002fc780] Timestamps are unset in a packet for stream 0. This
is deprecated and will stop working in the future. Fix your code to set the time
stamps properly
[mpegts @ 00000000002fc780] first pts value must be set
av_interleaved_write_frame(): Invalid data found when processing input
frame= 1 fps=0.0 q=-1.0 Lsize=N/A time=-00:00:00.03 bitrate=N/A speed=N/A

video:59kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
erhead: unknown
Conversion failed!

C:\Users\sunil\Downloads\ffmpeg-3.2.2-win64-static - Copy\ffmpeg-3.2.2-win64-sta
tic\bin>

ffmpeg -rtsp_transport tcp -i rtsp://root:kastle@192.168.17.153/axis-media/media.amp -vcodec copy output.ts

test without hls format

comment:8 Changed 9 months ago by ankit.gupta

This command seems to be helping, I tested it for last one week:

ffmpeg -rtsp_transport tcp -i {RTSP} -c:v libx264 -crf 35 -preset ultrafast -maxrate 3M -bufsize 100K -r 50 -g 100 -movflags +faststart -tune zerolatency -hls_time 1 -hls_list_size 4 -hls_wrap4 -start_number 1 -hls_allow_cache 0 -threads 1 -loglevel warning -y {M3U8}

Only pending issue now is its taking lot of memory and CPU resources, any thoughts on this?

comment:9 Changed 8 months ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.