[FFmpeg-trac] #7798(undetermined:new): hls muxer often generates segments shorter than -hls_time

FFmpeg trac at avcodec.org
Sun Mar 17 04:44:02 EET 2019


#7798: hls muxer often generates segments shorter than -hls_time
-------------------------------------+-------------------------------------
             Reporter:  JoshuaWalsh  |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:  hls          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by stevenliu):

 the hlsenc split the segment:
 If there have video stream, get current packet video, if the packet pts -
 the start of the segment pts is large than hls_time, and the packet flags
 is key, then close current file and open new file for the next segment.

 for example, if the source video keyframe is looks like this:
 kpppppppppkpppppppppkppppppppp
 if the fps is 5 and gop is 10, then the segment duration is 2
 if the source keyframe is looks like this:
 kppkppppppppkpppppppkpppkppkppp
 the 1st segment is: 12frames, fps is 5, 200ms per frame, 2.400000s, the
 2nd segment is 1.600000s

 if you want segment duration is 5s, the gop should right:

 -g 125 -r:v 25 is the basic setting,
 if you don't want set the gop;

 or you can submit a patch to fix the problem if you think that is a
 problem.

 try the git master version please.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7798#comment:9>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list