mirror of
https://github.com/livepeer/lpms
synced 2026-04-22 15:57:25 +08:00
chore: fix some typos in comment (#397)
Signed-off-by: kevincatty <zhanshanmao@outlook.com>
This commit is contained in:
+1
-1
@@ -64,7 +64,7 @@ LPMS transcoding would fail when segments or frames were sent out-of-order. This
|
||||
pts
|
||||
```
|
||||
|
||||
FPS filter expects monotonic increase in input frame's timestamps. As we cannot rely on the input to be monotonic, [we set dummy timestamps](https://github.com/livepeer/lpms/blob/e0a6002c849649d80a470c2d19130b279291051b/ffmpeg/filter.c#L308) that we manually increase monotonically, before frames are sent into the filtergraph. Later on, when the FPS filter has duplicated or dropped frames to match the target framerate, we [reconstruct the original timestamps](https://github.com/livepeer/lpms/blob/e0a6002c849649d80a470c2d19130b279291051b/ffmpeg/filter.c#L308) by taking a difference between the timestamps of the first frame of the segment before and after filtergraph, and applying this difference back to the ouptut in the timebase the encoder expects. This ensures the orignal playback order of the segments is restored in the transcoded output(s).
|
||||
FPS filter expects monotonic increase in input frame's timestamps. As we cannot rely on the input to be monotonic, [we set dummy timestamps](https://github.com/livepeer/lpms/blob/e0a6002c849649d80a470c2d19130b279291051b/ffmpeg/filter.c#L308) that we manually increase monotonically, before frames are sent into the filtergraph. Later on, when the FPS filter has duplicated or dropped frames to match the target framerate, we [reconstruct the original timestamps](https://github.com/livepeer/lpms/blob/e0a6002c849649d80a470c2d19130b279291051b/ffmpeg/filter.c#L308) by taking a difference between the timestamps of the first frame of the segment before and after filtergraph, and applying this difference back to the output in the timebase the encoder expects. This ensures the original playback order of the segments is restored in the transcoded output(s).
|
||||
|
||||
## Reusing transcoding session with HW codecs
|
||||
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ int lpms_rtmp2hls(char *listen, char *outf, char *ts_tmpl, char* seg_time, char
|
||||
if (oc->streams[pkt->stream_index]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
|
||||
AV_NOPTS_VALUE == dts_prev &&
|
||||
(pkt->flags & AV_PKT_FLAG_KEY)) got_video_kf = 1;
|
||||
if (!got_video_kf) goto r2hloop_end; // skip everyting until first video KF
|
||||
if (!got_video_kf) goto r2hloop_end; // skip everything until first video KF
|
||||
if (AV_NOPTS_VALUE == dts_prev) dts_prev = dts_next;
|
||||
else if (dts_next <= dts_prev) goto r2hloop_end; // drop late packets
|
||||
pkt->pts = av_rescale_q_rnd(pkt->pts, ist->time_base, ost->time_base,
|
||||
|
||||
@@ -215,7 +215,7 @@ func (s *FFMpegVideoSegmenter) pollPlaylist(ctx context.Context, fn string, slee
|
||||
func (s *FFMpegVideoSegmenter) pollSegment(ctx context.Context, curFn string, nextFn string, sleepTime time.Duration) (f []byte, err error) {
|
||||
var content []byte
|
||||
for {
|
||||
//Because FFMpeg keeps appending to the current segment until it's full before moving onto the next segment, we monitor the existance of
|
||||
//Because FFMpeg keeps appending to the current segment until it's full before moving onto the next segment, we monitor the existence of
|
||||
//the next file as a signal for the completion of the current segment.
|
||||
if _, err := os.Stat(nextFn); err == nil {
|
||||
content, err = ioutil.ReadFile(curFn)
|
||||
|
||||
@@ -76,7 +76,7 @@ func parsingAndStore(t *testing.T, infiles []string, outdir string, inTparam *[]
|
||||
if strings.Index(linestr, "{\"duration\"") != 0 {
|
||||
streamdata = streamdata + linestr
|
||||
} else {
|
||||
//fill up source video infomation
|
||||
//fill up source video information
|
||||
srcvinfo = string(linebyte)
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user