Scan video orientation (#5189)

* Adjust video dimensions for side data rotation
* Warn user when ffprobe version < 5. Only get rotation data on version >= 5
This commit is contained in:
WithoutPants
2024-09-03 16:33:15 +10:00
committed by GitHub
parent 899ee713ab
commit c21ded028a
12 changed files with 163 additions and 53 deletions

View File

@@ -18,7 +18,7 @@ func customUsage() {
flag.PrintDefaults()
}
func printPhash(ff *ffmpeg.FFMpeg, ffp ffmpeg.FFProbe, inputfile string, quiet *bool) error {
func printPhash(ff *ffmpeg.FFMpeg, ffp *ffmpeg.FFProbe, inputfile string, quiet *bool) error {
ffvideoFile, err := ffp.NewVideoFile(inputfile)
if err != nil {
return err
@@ -80,7 +80,7 @@ func main() {
ffmpegPath, ffprobePath := getPaths()
encoder := ffmpeg.NewEncoder(ffmpegPath)
// don't need to InitHWSupport, phashing doesn't use hw acceleration
ffprobe := ffmpeg.FFProbe(ffprobePath)
ffprobe := ffmpeg.NewFFProbe(ffprobePath)
for _, item := range args {
if err := printPhash(encoder, ffprobe, item, quiet); err != nil {