[FFmpeg-user] CONTINUOUS RTSP STREAM TO MP4 SEGMENTS

Alejandro Escudero escuderoserrano at hotmail.com
Wed Sep 4 00:08:06 EEST 2019


Hi,

I am trying to record an RTSP Stream in to several segments of MP4, the command works but at certain point in the segment 54 (00:04:34.19) it stops working. Which should be the proper way to get a continue stream recording to mp4 segments without facing this problem?


ffmpeg -rtsp_transport tcp -i "rtsp://admin:pass@myddns.dyndns.org:554/cam/realmonitor?channel=1&subtype=0" -f segment -segment_time 5 -c copy  RE%d.mp4




C:\Users\User\Desktop\ejemplosffmpeg>ffmpeg -rtsp_transport tcp -i "rtsp://admin:pass@myddns.dyndns.org:554/cam/realmonitor?channel=1&subtype=0" -f segment -segment_time 5 -c copy  RE%d.mp4

ffmpeg version N-94423-ga0c1970781 Copyright (c) 2000-2019 the FFmpeg developers

  built with gcc 9.1.1 (GCC) 20190716

  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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. 32.100 / 56. 32.100

  libavcodec     58. 55.100 / 58. 55.100

  libavformat    58. 30.100 / 58. 30.100

  libavdevice    58.  9.100 / 58.  9.100

  libavfilter     7. 58.100 /  7. 58.100

  libswscale      5.  6.100 /  5.  6.100

  libswresample   3.  6.100 /  3.  6.100

  libpostproc    55.  6.100 / 55.  6.100

Input #0, rtsp, from 'rtsp://admin:dahua2019@myipcameras.dyndns.org:554/cam/realmonitor?channel=1&subtype=0':

  Metadata:

    title           : Media Server

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

    Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 100 tbr, 90k tbn, 60 tbc

    Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

[segment @ 0000020fc050b040] Opening 'RE0.mp4' for writing

Output #0, segment, to 'RE%d.mp4':

  Metadata:

    title           : Media Server

    encoder         : Lavf58.30.100

    Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 100 tbr, 15360 tbn, 30 tbc

    Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

Stream mapping:

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

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

Press [q] to stop, [?] for help

[segment @ 0000020fc050b040] Non-monotonous DTS in output stream 0:0; previous: 3021, current: 461; changing to 3022. This may result in incorrect timestamps in the output file.

[segment @ 0000020fc050b040] Non-monotonous DTS in output stream 0:0; previous: 3022, current: 922; changing to 3023. This may result in incorrect timestamps in the output file.

[segment @ 0000020fc050b040] Non-monotonous DTS in output stream 0:0; previous: 3023, current: 1536; changing to 3024. This may result in incorrect timestamps in the output file.

[segment @ 0000020fc050b040] Non-monotonous DTS in output stream 0:0; previous: 3024, current: 1997; changing to 3025. This may result in incorrect timestamps in the output file.

[segment @ 0000020fc050b040] Non-monotonous DTS in output stream 0:0; previous: 3025, current: 2458; changing to 3026. This may result in incorrect timestamps in the output file.

[segment @ 0000020fc050b040] Opening 'RE1.mp4' for writingte=N/A speed= 1.2x

[segment @ 0000020fc050b040] Opening 'RE2.mp4' for writingte=N/A speed=1.13x

[segment @ 0000020fc050b040] Opening 'RE3.mp4' for writingte=N/A speed=1.06x

[segment @ 0000020fc050b040] Opening 'RE4.mp4' for writingte=N/A speed=1.06x

[segment @ 0000020fc050b040] Opening 'RE5.mp4' for writingte=N/A speed=1.04x

[segment @ 0000020fc050b040] Opening 'RE6.mp4' for writingte=N/A speed=1.04x

[segment @ 0000020fc050b040] Opening 'RE7.mp4' for writingte=N/A speed=1.03x

[segment @ 0000020fc050b040] Opening 'RE8.mp4' for writingte=N/A speed=1.03x

[segment @ 0000020fc050b040] Opening 'RE9.mp4' for writingte=N/A speed=1.02x

[segment @ 0000020fc050b040] Opening 'RE10.mp4' for writinge=N/A speed=1.02x

[segment @ 0000020fc050b040] Opening 'RE11.mp4' for writinge=N/A speed=1.02x

[segment @ 0000020fc050b040] Opening 'RE12.mp4' for writinge=N/A speed=1.02x

[segment @ 0000020fc050b040] Opening 'RE13.mp4' for writinge=N/A speed=1.02x

[segment @ 0000020fc050b040] Opening 'RE14.mp4' for writinge=N/A speed=1.02x

[segment @ 0000020fc050b040] Opening 'RE15.mp4' for writinge=N/A speed=1.02x

[segment @ 0000020fc050b040] Opening 'RE16.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE17.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE18.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE19.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE20.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE21.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE22.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE23.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE24.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE25.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE26.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE27.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE28.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE29.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE30.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE31.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE32.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE33.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE34.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE35.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE36.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE37.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE38.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE39.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE40.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE41.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE42.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE43.mp4' for writinge=N/A speed=1.01x

[segment @ 0000020fc050b040] Opening 'RE44.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE45.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE46.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE47.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE48.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE49.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE50.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE51.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE52.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE53.mp4' for writinge=N/A speed=   1x

[segment @ 0000020fc050b040] Opening 'RE54.mp4' for writinge=N/A speed=   1x

frame= 8220 fps= 30 q=-1.0 size=N/A time=00:04:34.19 bitrate=N/A speed=   1x



Thanks!


Alejandro

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>  Libre de virus. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>


More information about the ffmpeg-user mailing list