diff --git a/doc/quirks.md b/doc/quirks.md index ece540a05a..59824b0657 100644 --- a/doc/quirks.md +++ b/doc/quirks.md @@ -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 diff --git a/ffmpeg/extras.c b/ffmpeg/extras.c index 37b910c35e..471dd48d31 100644 --- a/ffmpeg/extras.c +++ b/ffmpeg/extras.c @@ -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, diff --git a/segmenter/video_segmenter.go b/segmenter/video_segmenter.go index d0913ec8ea..a032274110 100644 --- a/segmenter/video_segmenter.go +++ b/segmenter/video_segmenter.go @@ -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) diff --git a/transcoder/ffmpeg_segment_failcase_test.go b/transcoder/ffmpeg_segment_failcase_test.go index 6dda0c64a0..e13823f3dc 100644 --- a/transcoder/ffmpeg_segment_failcase_test.go +++ b/transcoder/ffmpeg_segment_failcase_test.go @@ -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 }