mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Fix playback with avi files missing PTS (#602)
This commit is contained in:
commit
4176bd0f0a
@ -1,9 +1,9 @@
|
|||||||
# FROM golang:1.22 as build
|
# FROM golang:1.22 as build
|
||||||
FROM debian:trixie-slim as build
|
FROM debian:trixie-slim AS build
|
||||||
# those were copied from https://github.com/docker-library/golang/blob/master/Dockerfile-linux.template
|
# those were copied from https://github.com/docker-library/golang/blob/master/Dockerfile-linux.template
|
||||||
ENV GOTOOLCHAIN=local
|
ENV GOTOOLCHAIN=local
|
||||||
ENV GOPATH /go
|
ENV GOPATH=/go
|
||||||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
|
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
FROM debian:trixie-slim
|
FROM debian:trixie-slim
|
||||||
# those were copied from https://github.com/docker-library/golang/blob/master/Dockerfile-linux.template
|
# those were copied from https://github.com/docker-library/golang/blob/master/Dockerfile-linux.template
|
||||||
ENV GOTOOLCHAIN=local
|
ENV GOTOOLCHAIN=local
|
||||||
ENV GOPATH /go
|
ENV GOPATH=/go
|
||||||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
|
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
|
@ -157,6 +157,8 @@ func getVideoKeyframes(path string, video_idx uint32, kf *Keyframe) error {
|
|||||||
"-loglevel", "error",
|
"-loglevel", "error",
|
||||||
"-select_streams", fmt.Sprintf("V:%d", video_idx),
|
"-select_streams", fmt.Sprintf("V:%d", video_idx),
|
||||||
"-show_entries", "packet=pts_time,flags",
|
"-show_entries", "packet=pts_time,flags",
|
||||||
|
// some avi files don't have pts, we use this to ask ffmpeg to generate them (it uses the dts under the hood)
|
||||||
|
"-fflags", "+genpts",
|
||||||
"-of", "csv=print_section=0",
|
"-of", "csv=print_section=0",
|
||||||
path,
|
path,
|
||||||
)
|
)
|
||||||
|
@ -238,6 +238,11 @@ func (ts *Stream) run(start int32) error {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
args = append(args,
|
args = append(args,
|
||||||
|
// some avi files are missing pts, using this flag makes ffmpeg use dts as pts and prevents an error with
|
||||||
|
// -c:v copy. Only issue: pts is sometime wrong (+1fps than expected) and this leads to some clients refusing
|
||||||
|
// to play the file (they just switch back to the previous quality).
|
||||||
|
// since this is better than errorring or not supporting transmux at all, i'll keep it here for now.
|
||||||
|
"-fflags", "+genpts",
|
||||||
"-i", ts.file.Info.Path,
|
"-i", ts.file.Info.Path,
|
||||||
// this makes behaviors consistent between soft and hardware decodes.
|
// this makes behaviors consistent between soft and hardware decodes.
|
||||||
// this also means that after a -ss 50, the output video will start at 50s
|
// this also means that after a -ss 50, the output video will start at 50s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user