Add HW ROTATION support to vaapi engine
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
package ffmpeg
|
package ffmpeg
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/rs/zerolog/log"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -54,6 +55,13 @@ func MakeHardware(args *Args, engine string) {
|
|||||||
if strings.HasPrefix(filter, "scale=") {
|
if strings.HasPrefix(filter, "scale=") {
|
||||||
args.filters[i] = "scale_vaapi=" + filter[6:]
|
args.filters[i] = "scale_vaapi=" + filter[6:]
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(filter, "transpose=") {
|
||||||
|
if strings.HasPrefix(filter, "transpose=1,transpose=1") { // 180 degrees half-turn
|
||||||
|
args.filters[i] = "transpose_vaapi=4" // reversal
|
||||||
|
} else {
|
||||||
|
args.filters[i] = "transpose_vaapi=" + filter[10:]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix if input doesn't support hwaccel, do nothing when support
|
// fix if input doesn't support hwaccel, do nothing when support
|
||||||
|
|||||||
Reference in New Issue
Block a user