Skip to content

Commit

Permalink
chore: fix some typos in comment (#397)
Browse files Browse the repository at this point in the history
Signed-off-by: kevincatty <[email protected]>
  • Loading branch information
kevincatty authored Jul 25, 2024
1 parent 5d250f1 commit 4b092b8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/quirks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/extras.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion segmenter/video_segmenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion transcoder/ffmpeg_segment_failcase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 4b092b8

Please sign in to comment.