Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

433
Views
Setting HLS segment times

I am passing a processed video from openCV to ffmpeg via a pipe here is the code

./OpenCV & \
 tail -n +0 -f out.avi  | ffmpeg -i pipe:0  -hls_time 1 -hls_list_size 0 -hls_wrap 10 -hls_segment_filename '%03d.ts' stream.m3u8 

My issue is the output .ts files are not in a uniformed duration they change from file to file.

These are mostly long say 60 seconds. This means the connecting client has to wait for the first stream to finish before the playlist file (.m3u8) file is created. Therefor in this example they are 60 seconds or so behind live video and if the next .ts file is larger the streaming stops until this is finished. If the client tries to play before the next .ts file is created they are played the first .ts file.

The frame rate from openCV is 1 frame per second.

tail changes the output file of openCV called (out.avi) to a stdout.

Any help would be great.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I know I am answering my own question but I have changed the code below

./OpenCV & \
 tail -n +0 -f out.avi  | ffmpeg -i pipe:0  -hls_time 1 -hls_list_size 0 -hls_wrap 10 -hls_segment_filename '%03d.ts' stream.m3u8 `

to

./OpenCV & \
tail -n +0 -f out.avi  | ffmpeg -i pipe:0 -f hls -g 2 -hls_time 2 -hls_list_size 0 -hls_wrap 10 -hls_segment_filename '%03d.ts' stream.m3u8 `

Seems to have done the trick.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!