[Libav-user] EPERM when seeking in live HLS

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Libav-user] EPERM when seeking in live HLS

Louis Letourneau
I'm trying to process a live HLS stream. The source encoding comes from ffmpeg using -hls_playlist_type event so it's seekable.

most of the time there is no issue, but once in awhile when calling:
int ret = av_seek_frame(ic, videostream, timestamp, AVSEEK_FLAG_BACKWARD);
if(ret < 0) {
    char buf[2048];
    av_strerror(ret, buf, 2048);
    printf("Couldn't seek!!!!! Reason: %s\n", buf);

I get EPERM (Operation not permitted).

Then I just need to wait ~1s retry and it works.

When enabling full debug, there are 2 messages that popup when the error occurs:
no picture ooo
Frame num gap 1 14
Frame num gap 1 15

These both happen in libavcodec/h264_slice.c

Can anyone explain what could cause this? I don't 100% understand what could cause this.

Oh and this never ever happens once the m3u8 is complete and is not live anymore.

Thank you

P.S. if it helps here's the full encoding syntax:
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

Libav-user mailing list
[hidden email]

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".