CPU transcoding works, quicksync needs help
This commit is contained in:
@@ -16,3 +16,28 @@ ffmpeg -y -i input.mp4 \
|
||||
* -g 72 -keyint_min 72: Forces a keyframe exactly every 72 frames. At 24fps, this yields an exact 3-second fragment duration.
|
||||
* -sc_threshold 0: Disables adaptive scene-change keyframes. Without this, your streams will have misaligned keyframes, and Bento4 will fail to package them as a single adaptive HLS stream.
|
||||
* -an and -vn: Separates the audio from the video files. Bento4 handles multiplexing and packaging best when audio and video tracks are fed as distinct source files.
|
||||
|
||||
|
||||
# Configuring for quicksync
|
||||
|
||||
1:N transcoding workflow that leverages the GPU hardware filter scale_qsv. This reads the input frame once, scales it on the Intel GPU, and encodes both outputs simultaneously.
|
||||
|
||||
```bash
|
||||
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 \
|
||||
-filter_complex "[0:v]split=2[s1][s2]; \
|
||||
[s1]scale_qsv=w=1280:h=720[v720]; \
|
||||
[s2]scale_qsv=w=854:h=480[v480]" \
|
||||
-map "[v720]" -c:v h264_qsv -b:v 2500k -maxrate 2500k -bufsize 5000k \
|
||||
-g 60 -keyint_min 60 -sc_threshold 0 -forced-idr 1 -an video_720p.mp4 \
|
||||
-map "[v480]" -c:v h264_qsv -b:v 1000k -maxrate 1000k -bufsize 2000k \
|
||||
-g 60 -keyint_min 60 -sc_threshold 0 -forced-idr 1 -an video_480p.mp4 \
|
||||
-map 0:a? -c:a aac -b:a 128k audio.mp4
|
||||
```
|
||||
|
||||
Key Argument Explanations:
|
||||
* -hwaccel qsv -c:v h264_qsv: Invokes hardware decoding and initialization.
|
||||
* scale_qsv=w=...:h=...: Tells the Intel GPU to handle the video resizing directly inside the Quick Sync processing pipeline.
|
||||
* -g 60 -keyint_min 60: Dictates the GOP size (assuming a 30fps input video, a GOP of 60 forces a keyframe exactly every 2 seconds).
|
||||
* -sc_threshold 0: Disables scene change detection to ensure keyframes are purely fixed.
|
||||
* -forced-idr 1: Forces the QSV encoder to use actual IDR frames instead of basic I-frames at the GOP boundary, which is necessary for fragmenting tools.
|
||||
* -an: Strips audio out of the video streams so Bento4 can package them as clean, isolated tracks.
|
||||
|
||||
Reference in New Issue
Block a user