Skip to content

Commit

Permalink
Include lpms min enc resolution (#2466)
Browse files Browse the repository at this point in the history
* Include lpms fix; use `ffmpeg.MediaFormatInfo` struct.
  • Loading branch information
AlexKordic authored Jun 21, 2022
1 parent 613e60b commit 9324731
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#### Transcoder

### Bug Fixes 🐞
- \#2466 bugfix: rendition resolution fix for portrait input videos; Min resolution applied for Nvidia hardware (@AlexKordic)

#### CLI
- \#2456 cli: Show O rather than B options when -redeemer flag set (@thomshutt)
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ require (
github.com/golang/mock v1.5.0
github.com/golang/protobuf v1.5.2
github.com/jaypipes/ghw v0.9.0
github.com/jaypipes/pcidb v1.0.0
github.com/livepeer/livepeer-data v0.4.11
github.com/livepeer/lpms v0.0.0-20220523122311-fc32eb80248c
github.com/livepeer/lpms v0.0.0-20220616165036-d82aa89e2477
github.com/livepeer/m3u8 v0.11.1
github.com/mattn/go-sqlite3 v1.11.0
github.com/olekukonko/tablewriter v0.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ github.com/livepeer/joy4 v0.1.2-0.20191121080656-b2fea45cbded h1:ZQlvR5RB4nfT+cO
github.com/livepeer/joy4 v0.1.2-0.20191121080656-b2fea45cbded/go.mod h1:xkDdm+akniYxVT9KW1Y2Y7Hso6aW+rZObz3nrA9yTHw=
github.com/livepeer/livepeer-data v0.4.11 h1:Sv+ss8e4vcscnMWLxcRJ2g3sNIHyQ3RzCtgEelfGPzw=
github.com/livepeer/livepeer-data v0.4.11/go.mod h1:VIbJRdyH2Tas8EgLVkP79IPMepFDOv0dgHYLEZsCaf4=
github.com/livepeer/lpms v0.0.0-20220523122311-fc32eb80248c h1:LFwabjsjQU/bxVdULWNAWFnvoCdO9qzl5IYQXdCSDLI=
github.com/livepeer/lpms v0.0.0-20220523122311-fc32eb80248c/go.mod h1:Hr/JhxxPDipOVd4ZrGYWrdJfpVF8/SEI0nNr2ctAlkM=
github.com/livepeer/lpms v0.0.0-20220616165036-d82aa89e2477 h1:d1tBqdLsPRM/GTvujGeRFFHlidA8mBizsTl8ea9tQxc=
github.com/livepeer/lpms v0.0.0-20220616165036-d82aa89e2477/go.mod h1:Hr/JhxxPDipOVd4ZrGYWrdJfpVF8/SEI0nNr2ctAlkM=
github.com/livepeer/m3u8 v0.11.1 h1:VkUJzfNTyjy9mqsgp5JPvouwna8wGZMvd/gAfT5FinU=
github.com/livepeer/m3u8 v0.11.1/go.mod h1:IUqAtwWPAG2CblfQa4SVzTQoDcEMPyfNOaBSxqHMS04=
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
Expand Down
12 changes: 6 additions & 6 deletions server/mediaserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var DetectionWhClient = &http.Client{Timeout: 2 * time.Second}
var SelectRandFreq float64

func PixelFormatNone() ffmpeg.PixelFormat {
return ffmpeg.PixelFormat{ffmpeg.PixelFormatNone}
return ffmpeg.PixelFormat{RawValue: ffmpeg.PixelFormatNone}
}

// For HTTP push watchdog
Expand Down Expand Up @@ -817,21 +817,21 @@ func (s *LivepeerServer) HandlePush(w http.ResponseWriter, r *http.Request) {
ctx = clog.AddNonce(ctx, cxn.nonce)
}

status, _, vcodecStr, pixelFormat, err := ffmpeg.GetCodecInfoBytes(body)
status, mediaFormat, err := ffmpeg.GetCodecInfoBytes(body)
isZeroFrame := status == ffmpeg.CodecStatusNeedsBypass
if err != nil {
errorOut(http.StatusUnprocessableEntity, "Error getting codec info url=%s", r.URL)
return
}

var vcodec *ffmpeg.VideoCodec
if len(vcodecStr) == 0 {
if len(mediaFormat.Vcodec) == 0 {
clog.Warningf(ctx, "Couldn't detect input video stream codec")
} else {
vcodecVal, ok := ffmpeg.FfmpegNameToVideoCodec[vcodecStr]
vcodecVal, ok := ffmpeg.FfmpegNameToVideoCodec[mediaFormat.Vcodec]
vcodec = &vcodecVal
if !ok {
errorOut(http.StatusUnprocessableEntity, "Unknown input stream codec=%s", vcodecStr)
errorOut(http.StatusUnprocessableEntity, "Unknown input stream codec=%s", mediaFormat.Vcodec)
return
}
}
Expand Down Expand Up @@ -875,7 +875,7 @@ func (s *LivepeerServer) HandlePush(w http.ResponseWriter, r *http.Request) {
}
}

cxn, err = s.registerConnection(ctx, st, vcodec, pixelFormat, segPar)
cxn, err = s.registerConnection(ctx, st, vcodec, mediaFormat.PixFormat, segPar)
if err != nil {
st.Close()
if err != errAlreadyExists {
Expand Down

0 comments on commit 9324731

Please sign in to comment.