-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IDK if these actually work, as I don't have the hardware for them...
- Loading branch information
Showing
10 changed files
with
207 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
server/src/main/java/xyz/e3ndr/athena/transcoding/accelerator/AmdPreferred.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package xyz.e3ndr.athena.transcoding.accelerator; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import lombok.NonNull; | ||
import xyz.e3ndr.athena.types.VideoCodec; | ||
import xyz.e3ndr.athena.types.VideoQuality; | ||
|
||
class AmdPreferred implements Accelerator { | ||
|
||
@Override | ||
public @Nullable List<String> v_getFF(@NonNull VideoCodec codec, @NonNull VideoQuality quality) { | ||
switch (codec) { | ||
case H264_BASELINE: | ||
return Arrays.asList( | ||
"-c:v", "h264_amf", | ||
"-profile:v", "baseline", | ||
"-pix_fmt", "yuv420p" | ||
); | ||
|
||
case H264_HIGH: | ||
return Arrays.asList( | ||
"-c:v", "h264_amf", | ||
"-profile:v", "high", | ||
"-pix_fmt", "yuv420p", | ||
"-level", "5.0", | ||
"-preset", "slow" | ||
); | ||
|
||
// TODO the more advanced parameters for HEVC and AV1 | ||
case HEVC: | ||
return Arrays.asList( | ||
"-c:v", "hevc_amf" | ||
); | ||
|
||
case AV1: | ||
return Arrays.asList( | ||
"-c:v", "av1_amf" | ||
); | ||
|
||
default: | ||
return null; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
server/src/main/java/xyz/e3ndr/athena/transcoding/accelerator/QuickSyncPreferred.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package xyz.e3ndr.athena.transcoding.accelerator; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import lombok.NonNull; | ||
import xyz.e3ndr.athena.types.VideoCodec; | ||
import xyz.e3ndr.athena.types.VideoQuality; | ||
|
||
class QuickSyncPreferred implements Accelerator { | ||
|
||
@Override | ||
public @Nullable List<String> v_getFF(@NonNull VideoCodec codec, @NonNull VideoQuality quality) { | ||
switch (codec) { | ||
case H264_BASELINE: | ||
return Arrays.asList( | ||
"-c:v", "h264_qsv", | ||
"-profile:v", "baseline", | ||
"-pix_fmt", "yuv420p" | ||
); | ||
|
||
case H264_HIGH: | ||
return Arrays.asList( | ||
"-c:v", "h264_qsv", | ||
"-profile:v", "high", | ||
"-pix_fmt", "yuv420p", | ||
"-level", "5.0", | ||
"-preset", "slow" | ||
); | ||
|
||
// TODO the more advanced parameters for HEVC and AV1 | ||
case HEVC: | ||
return Arrays.asList( | ||
"-c:v", "hevc_qsv" | ||
); | ||
|
||
case AV1: | ||
return Arrays.asList( | ||
"-c:v", "av1_qsv" | ||
); | ||
|
||
default: | ||
return null; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
server/src/main/java/xyz/e3ndr/athena/transcoding/accelerator/V4lPreferred.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package xyz.e3ndr.athena.transcoding.accelerator; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import lombok.NonNull; | ||
import xyz.e3ndr.athena.types.VideoCodec; | ||
import xyz.e3ndr.athena.types.VideoQuality; | ||
|
||
class V4lPreferred implements Accelerator { | ||
|
||
@Override | ||
public @Nullable List<String> v_getFF(@NonNull VideoCodec codec, @NonNull VideoQuality quality) { | ||
switch (codec) { | ||
case H264_BASELINE: | ||
return Arrays.asList( | ||
"-c:v", "h264_v4l2m2m", | ||
"-profile:v", "baseline", | ||
"-pix_fmt", "yuv420p" | ||
); | ||
|
||
case H264_HIGH: | ||
return Arrays.asList( | ||
"-c:v", "h264_v4l2m2m", | ||
"-profile:v", "high", | ||
"-pix_fmt", "yuv420p", | ||
"-level", "5.0", | ||
"-preset", "slow" | ||
); | ||
|
||
// TODO the more advanced parameters for HEVC and AV1 | ||
case HEVC: | ||
return Arrays.asList( | ||
"-c:v", "hevc_v4l2m2m" | ||
); | ||
|
||
case AV1: | ||
return Arrays.asList( | ||
"-c:v", "av1_v4l2m2m" | ||
); | ||
|
||
default: | ||
return null; | ||
} | ||
} | ||
|
||
} |
54 changes: 54 additions & 0 deletions
54
server/src/main/java/xyz/e3ndr/athena/transcoding/accelerator/VaapiPreferred.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package xyz.e3ndr.athena.transcoding.accelerator; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import lombok.NonNull; | ||
import xyz.e3ndr.athena.types.VideoCodec; | ||
import xyz.e3ndr.athena.types.VideoQuality; | ||
|
||
class VaapiPreferred implements Accelerator { | ||
private static final String VAAPI_DEVICE = System.getProperty("athena.vaapi.device", "/dev/dru/renderD128"); | ||
|
||
@Override | ||
public @Nullable List<String> v_getFF(@NonNull VideoCodec codec, @NonNull VideoQuality quality) { | ||
switch (codec) { | ||
case H264_BASELINE: | ||
return Arrays.asList( | ||
"-vaapi_device", VAAPI_DEVICE, | ||
"-c:v", "h264_vaapi", | ||
"-profile:v", "baseline", | ||
"-pix_fmt", "yuv420p" | ||
); | ||
|
||
case H264_HIGH: | ||
return Arrays.asList( | ||
"-vaapi_device", VAAPI_DEVICE, | ||
"-c:v", "h264_vaapi", | ||
"-profile:v", "high", | ||
"-pix_fmt", "yuv420p", | ||
"-level", "5.0", | ||
"-preset", "slow" | ||
); | ||
|
||
// TODO the more advanced parameters for HEVC and AV1 | ||
case HEVC: | ||
return Arrays.asList( | ||
"-vaapi_device", VAAPI_DEVICE, | ||
"-c:v", "hevc_vaapi" | ||
); | ||
|
||
case AV1: | ||
return Arrays.asList( | ||
"-vaapi_device", VAAPI_DEVICE, | ||
"-c:v", "av1_vaapi" | ||
); | ||
|
||
default: | ||
return null; | ||
} | ||
} | ||
|
||
} |