2

I have an input HLS stream stream.m3u8 using my macbook camera by running:

ffmpeg -f avfoundation ^
   -framerate 30 -i 0  ^
   -c:v libx264 -c:a aac -b:a 128k ^
   -ac 2 -crf 5 -preset veryfast -hls_time 1 ^
   -g 30 -sc_threshold 0 -f hls -hls_init_time 1 ^
   -hls_list_size 180 -hls_delete_threshold 180  ^
   -hls_flags delete_segments -hls_start_number_source datetime stream.m3u8

I want to use FFMPEG to create another HLS stream stream-60.m3u8 in which the video is delayed by an arbitrary amount of seconds, e.g. 30s.

I tried:

ffmpeg -itsoffset 30 -i ./stream.m3u8 -c copy stream-60.m3u8

But the video delay is around 5s.

1 Answer 1

1

Have you tried using the time syntax [-]hh:mm:ss[.xxx]?

ffmpeg -itsoffset 00:00:30.0000 -i ./stream.m3u8 -c copy stream-60.m3u8
4
  • Yes, the offset is still fixed to ~5s Commented May 10, 2023 at 6:49
  • Go with me for a second. If it's only 5secs when sent to 30secs, try setting it to 55secs. I'm wondering if it's only doing 5secs delay that you are seeing b/c of the streaming process (AKA something else is causing a 25sec delay). At least this way you could troubleshoot it.
    – TechLoom
    Commented May 10, 2023 at 14:23
  • I tested out various times and it is always ~5s of delay Commented May 11, 2023 at 15:06
  • I'm sure you have already tested to make sure you are running the latest version of FFMPEG. If you are on a Linux Distro you could look at pulling the source and recompile. It could be how the config was done on the compiled version.
    – TechLoom
    Commented May 16, 2023 at 17:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .