[FFmpeg-user] hls_init_time problem

? ? closezling at outlook.com
Fri Apr 14 13:40:03 EEST 2017


Thx for reply. I use brew install the latest ffmpeg version 3.3

console log as below,rtsp stream without audio

$ ffmpeg -rtsp_transport tcp -i rtsp://192.168.0.40/1/h264major -vcodec copy -acodec aac -hls_init_time 2 -hls_time 60 -hls_list_size 0 -hls_flags single_file+round_durations -hls_segment_filename test.ts -t 3600 test.m3u8
ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.41)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libavresample   3.  5.  0 /  3.  5.  0
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
libpostproc    54.  5.100 / 54.  5.100
Input #0, rtsp, from 'rtsp://192.168.0.40/1/h264major':
Metadata:
  title           : 1/h264major
  comment         : 1/h264major
Duration: N/A, start: 0.238944, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 25 fps, 25 tbr, 90k tbn, 50 tbc
Output #0, hls, to 'test.m3u8':
Metadata:
  title           : 1/h264major
  comment         : 1/h264major
  encoder         : Lavf57.71.100
  Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[hls @ 0x7f93e6800000] Non-monotonous DTS in output stream 0:0; previous: 0, current: -17706; changing to 1. This may result in incorrect timestamps in the output file.
[hls @ 0x7f93e6800000] Non-monotonous DTS in output stream 0:0; previous: 1, current: -14322; changing to 2. This may result in incorrect timestamps in the output file.
[hls @ 0x7f93e6800000] Non-monotonous DTS in output stream 0:0; previous: 2, current: -11675; changing to 3. This may result in incorrect timestamps in the output file.
[hls @ 0x7f93e6800000] Non-monotonous DTS in output stream 0:0; previous: 3, current: -7183; changing to 4. This may result in incorrect timestamps in the output file.
[hls @ 0x7f93e6800000] Non-monotonous DTS in output stream 0:0; previous: 4, current: -3596; changing to 5. This may result in incorrect timestamps in the output file.
[hls @ 0x7f93e6800000] Non-monotonous DTS in output stream 0:0; previous: 5, current: 1; changing to 6. This may result in incorrect timestamps in the output file.
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts9x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts3x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts1x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts8x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts7x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts6x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts5x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts5x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts4x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts4x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts4x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts3x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts3x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts3x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts3x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts3x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts2x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts2x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts2x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts2x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts2x
[hls muxer @ 0x7f93e680e200] Duplicated segment filename detected: test.ts2x

test.m3u8

$ cat test.m3u8
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:4,
#EXT-X-BYTERANGE:812348 at 0
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:389912 at 812348
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:389724 at 1202260
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:392168 at 1591984
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:412472 at 1984152
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:395364 at 2396624
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:400816 at 2791988
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:397808 at 3192804
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:399312 at 3590612
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:393484 at 3989924
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:397432 at 4383408
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:397620 at 4780840
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:392544 at 5178460
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:393484 at 5571004
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:394048 at 5964488
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:389536 at 6358536
test.ts


I did another test with rasp stream with video and audio

console output:

ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin@192.168.0.103/cam/realmonitor?channel=1&subtype=0" -vcodec copy -acodec aac -hls_init_time 2 -hls_time 60 -hls_list_size 0 -hls_flags +single_file+round_durations -hls_segment_filename test.ts -t 3600 test.m3u8
ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.41)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libavresample   3.  5.  0 /  3.  5.  0
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
libpostproc    54.  5.100 / 54.  5.100
Input #0, rtsp, from 'rtsp://admin:admin@192.168.0.103/cam/realmonitor?channel=1&subtype=0':
Metadata:
  title           : RTSP Session/2.0
Duration: N/A, start: 0.040000, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1280x720, 25.08 tbr, 90k tbn, 180k tbc
Output #0, hls, to 'test.m3u8':
Metadata:
  title           : RTSP Session/2.0
  encoder         : Lavf57.71.100
  Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1280x720, q=2-31, 25.08 tbr, 90k tbn, 90k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[hls @ 0x7fa2f1800000] 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 timestamps properly
[hls @ 0x7fa2f1800000] Non-monotonous DTS in output stream 0:0; previous: 0, current: 0; changing to 1. This may result in incorrect timestamps in the output file.
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 41 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 13 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 13 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 1 times
[hls muxer @ 0x7fa2f1805200] Duplicated segment filename detected: test.ts
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 10 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 11 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 13 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls muxer @ 0x7fa2f1805200] Duplicated segment filename detected: test.ts
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 14 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 13 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 7 times
[hls muxer @ 0x7fa2f1805200] Duplicated segment filename detected: test.ts
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 4 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 13 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 12 times
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 4 times

test.m3u8:

$ cat test.m3u8
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:4,
#EXT-X-BYTERANGE:1009936 at 0
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:562120 at 1009936
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:539372 at 1572056
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:526212 at 2111428
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:531100 at 2637640
test.ts
#EXTINF:2,
#EXT-X-BYTERANGE:531664 at 3168740
test.ts
#EXTINF:1,
#EXT-X-BYTERANGE:397244 at 3700404
test.ts
#EXT-X-ENDLIST

btw, in version 3.2.4 there is no log like
Duplicated segment filename detected: test.ts2x
[hls @ 0x7fa2f1800000] pkt->duration = 0, maybe the hls segment duration will not precise
  Last message repeated 41 times
when i use single_file flag



> On 14 Apr 2017, at 6:11 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 
> 2017-04-14 10:46 GMT+02:00 ? ? <closezling at outlook.com>:
> 
>> ffmpeg -rtsp_transport tcp -i rtsp://192.168.0.40/1/h264major
>> -vcodec copy -acodec aac -hls_init_time 2 -hls_time 60
>> -hls_list_size 0  -hls_flags +single_file+round_durations
>> -hls_segment_filename test.ts -t 3600 test.m3u8
> 
> Please test current FFmpeg git head and please provide the
> complete, uncut console output.
> 
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list