1

I am trying to convert an RTP stream (opus, vp8) to HLS (aac,libx264) but it fails. I can easily save the stream as WebM but I can not save it as HLS and the only noticeable error is cur_dts is invalid. but the fact that it is convertible to WebM could mean that there must be a way to convert it to HLS.

It seems it is related to timestamps of video which are out of order. but none of the flags genpts igndts or discardcorrupt helped me. I also tried -use_wallclock_as_timestamps 1

ffmpeg 
-loglevel debug
-protocol_whitelist pipe,udp,rtp 
-f sdp 
-fflags genpts,
-analyzeduration 10000000,
-probesize 10000000',
-i pipe:0 
-y -c:v libx264 -crf 25 
-vprofile baseline 
-r 24 -g 24 
-c:a aac 
-hls_list_size 1 
-hls_time 2 
-hls_playlist_type event 
-hls_flags independent_segments 
-sc_threshold 0 
-preset veryfast 
b3a7f37f-972e-4784-8bf7-eaaad258d3c8.m3u8 

The output:

Stderr output:  [libx264 @ 0x6d01540] frame= 124 QP=16.26 NAL=2 Slice:P Poc:8   I:6    P:12   SKIP:3582 size=75 bytes
0|app  |  Stderr output:  cur_dts is invalid (this is harmless if it occurs once at the start per stream)
0|app  |  Stderr output:      Last message repeated 1 times
0|app  |  Stderr output:  [libx264 @ 0x6d01540] frame= 125 QP=13.45 NAL=2 Slice:P Poc:10  I:8    P:6    SKIP:3586 size=55 bytes
0|app  |  Stderr output:  cur_dts is invalid (this is harmless if it occurs once at the start per stream)
0|app  |  Stderr output:      Last message repeated 3 times
0|app  |  Stderr output:  *** dropping frame 140 from stream 0 at ts 138
0|app  |  Stderr output:  [libx264 @ 0x6d01540] frame= 126 QP=15.22 NAL=2 Slice:P Poc:12  I:7    P:6    SKIP:3587 size=59 bytes
0|app  |  Stderr output:  cur_dts is invalid (this is harmless if it occurs once at the start per stream)
0|app  |  Stderr output:      Last message repeated 1 times
0|app  |  Stderr output:  [libx264 @ 0x6d01540] frame= 127 QP=14.70 NAL=2 Slice:P Poc:14  I:8    P:7    SKIP:3585 size=65 bytes
0|app  |  Stderr output:  cur_dts is invalid (this is harmless if it occurs once at the start per stream)
0|app  |  Stderr output:      Last message repeated 1 times
0|app  |  Stderr output:  [libx264 @ 0x6d01540] frame= 128 QP=15.12 NAL=2 Slice:P Poc:16  I:4    P:9    SKIP:3587 size=61 bytes
0|app  |  Stderr output:  Too many packets buffered for output stream 0:0.
0|app  |  Stderr output:  [libx264 @ 0x6d01540] frame I:6     Avg QP:10.60  size:  3053
0|app  |  Stderr output:  [libx264 @ 0x6d01540] frame P:123   Avg QP:15.13  size:    88
0|app  |  Stderr output:  [libx264 @ 0x6d01540] mb I  I16..4: 100.0%  0.0%  0.0%
0|app  |  Stderr output:  [libx264 @ 0x6d01540] mb P  I16..4:  0.2%  0.0%  0.0%  P16..4:  0.4%  0.0%  0.0%  0.0%  0.0%    skip:99.4%
0|app  |  Stderr output:  [libx264 @ 0x6d01540] coded y,uvDC,uvAC intra: 0.2% 3.0% 0.0% inter: 0.0% 0.4% 0.0%
0|app  |  Stderr output:  [libx264 @ 0x6d01540] i16 v,h,dc,p: 98%  0%  2%  0%
0|app  |  Stderr output:  [libx264 @ 0x6d01540] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  0%  0% 100%  0%  0%  0%  0%  0%  0%
0|app  |  Stderr output:  [libx264 @ 0x6d01540] i8c dc,h,v,p: 98%  1%  1%  0%
0|app  |  Stderr output:  [libx264 @ 0x6d01540] kb/s:43.38
0|app  |  Stderr output:  [AVIOContext @ 0x6c58ac0] Statistics: 210 bytes read, 0 seeks
0|app  |  Stderr output:  Conversion failed!

I also tried -use_wallclock_as_timestamps 1 and the output changes to this:

[hls @ 0x7021680] Delay between the first packet and last packet in the muxing queue is 10029056 > 10000000: forcing output
0|app  |  Stderr output:  cur_dts is invalid (this is harmless if it occurs once at the start per stream)
0|app  |  Stderr output:  [hls @ 0x7021680] Delay between the first packet and last packet in the muxing queue is 10026800 > 10000000: forcing output
0|app  |  Stderr output:  cur_dts is invalid (this is harmless if it occurs once at the start per stream)
0|app  |  Stderr output:  [hls @ 0x7021680] Delay between the first packet and last packet in the muxing queue is 10027288 > 10000000: forcing output
0|app  |  Stderr output:  cur_dts is invalid (this is harmless if it occurs once at the start per stream)
0|app  |  Stderr output:  [hls @ 0x7021680] Delay between the first packet and last packet in the muxing queue is 10033722 > 10000000: forcing output
0|app  |  Stderr output:  [hls @ 0x7021680] Delay between the first packet and last packet in the muxing queue is 10005822 > 10000000: forcing output
0|app  |  Stderr output:  cur_dts is invalid (this is harmless if it occurs once at the start per stream)
0|app  |  Stderr output:      Last message repeated 1 times

0 Answers0