When encoding a YUV file using x264, frames are missing from the final muxed MP4 output.
Steps to Reproduce:
- Use the following test configuration:
test {
input {
filepath: "Cactus_1920x1080_50.yuv"
resolution: "1920x1080"
framerate: 50
}
common {
id: "bitrate_buffer"
description: "Verify encoding bitrate - buffer"
}
configure {
codec: "libnativeencoder_master.so"
bitrate: "3000 kbps"
i_frame_interval: 100
}
}
- Run the test with a 200-frame input file.
- Check the output MP4 file and count the frames.
Note: number of frames can be check via this command:
ffprobe -select_streams v -count_frames -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 output.mp4
Expected Behavior:
The output MP4 file should contain all 200 frames.
Observed Behavior:
The output MP4 file contains only 159 frames, meaning some frames are missing.
Workaround:
Adding the following parameter to the encoder configuration prevents the issue:
parameter {
key: "tune"
type: stringType
value: "zerolatency"
}
After adding this parameter, no frames are missing.
Additional Notes:
- The issue may be related to buffering or delayed frame output in x264.
- It would be helpful to investigate if the encoder is not flushing frames correctly without the "zerolatency" option.
Please let me know if further details or logs are needed.
When encoding a YUV file using x264, frames are missing from the final muxed MP4 output.
Steps to Reproduce:
Note: number of frames can be check via this command:
Expected Behavior:
The output MP4 file should contain all 200 frames.
Observed Behavior:
The output MP4 file contains only 159 frames, meaning some frames are missing.
Workaround:
Adding the following parameter to the encoder configuration prevents the issue:
After adding this parameter, no frames are missing.
Additional Notes:
Please let me know if further details or logs are needed.