<div dir="ltr">I'm trying to process a live HLS stream. The source encoding comes from ffmpeg using -hls_playlist_type event so it's seekable.<div><br></div><div>most of the time there is no issue, but once in awhile when calling:</div><div>int ret = av_seek_frame(ic, videostream, timestamp, AVSEEK_FLAG_BACKWARD);<br>if(ret < 0) {<br>    char buf[2048];<br>    av_strerror(ret, buf, 2048);<br>    printf("Couldn't seek!!!!! Reason: %s\n", buf);<br>    break;<br>}</div><div><br></div><div>I get EPERM (Operation not permitted).</div><div><br></div><div>Then I just need to wait ~1s retry and it works.</div><div><br></div><div>When enabling full debug, there are 2 messages that popup when the error occurs:</div><div>no picture ooo</div><div>and</div><div>Frame num gap 1 14</div><div>Frame num gap 1 15</div><div><br></div><div>These both happen in libavcodec/h264_slice.c</div><div><br></div><div>Can anyone explain what could cause this? I don't 100% understand what could cause this.</div><div><br></div><div>Oh and this never ever happens once the m3u8 is complete and is not live anymore.</div><div><br></div><div>Thank you</div><span class="gmail-HOEnZb"><font color="#888888"><div>Louis</div></font></span><div><br></div><div>P.S. if it helps here's the full encoding syntax:</div><div>ffmpeg -re -i z.m3u8 -an -codec:v libx264 -crf 23 -preset fast -pix_fmt yuv420p -force_key_frames "expr:gte(t,n_forced*5)" -bf 0 -hls_time 5 -hls_list_size 0 -hls_wrap 0 -hls_allow_cache 1 -hls_playlist_type event -hls_segment_filename "w/w-1_%04d.ts" w/w-1.m3u8</div></div>