Skip to content

Commit

Permalink
fix the tests by removing circular dep
Browse files Browse the repository at this point in the history
Signed-off-by: Batuhan Apaydin <[email protected]>
  • Loading branch information
developer-guy committed Dec 1, 2024
1 parent 10da6cc commit 4a36583
Showing 1 changed file with 36 additions and 19 deletions.
55 changes: 36 additions & 19 deletions x265.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,40 @@ update:
git: {}

test:
environment:
contents:
packages:
- ffmpeg
pipeline:
- name: Verify x265 binary exists
runs: |
x265 --version
- name: Generate a sample video
runs: |
ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=25 -pix_fmt yuv420p sample.y4m
- name: Encode the generated sample video to raw H.265
runs: |
x265 --input sample.y4m --output encoded.h265
- name: Package raw H.265 stream into an MP4 container
runs: |
ffmpeg -i encoded.h265 -c copy encoded.mp4
- name: Verify the encoded video is a valid MP4 file
runs: |
ffprobe -v error -show_entries format=format_name -of default=noprint_wrappers=1:nokey=1 encoded.mp4 | grep -q 'mp4'
- runs: |
# Create a temporary raw YUV file (empty video, just for testing)
RAW_YUV="test.yuv"
WIDTH=1920
HEIGHT=1080
FPS=30
FRAMES=10
# Calculate frame size for YUV420p format
FRAME_SIZE=$((WIDTH * HEIGHT * 3 / 2))
echo "Generating raw YUV file ($WIDTH x $HEIGHT, $FRAMES frames)..."
dd if=/dev/zero of=$RAW_YUV bs=$FRAME_SIZE count=$FRAMES status=none
# Output file
OUTPUT_HEVC="test_output.hevc"
echo "Encoding YUV to HEVC using x265..."
x265 --input $RAW_YUV \
--input-res ${WIDTH}x${HEIGHT} \
--fps $FPS \
--frames $FRAMES \
--output $OUTPUT_HEVC
# Check if the output file was created
if [ -f "$OUTPUT_HEVC" ]; then
echo "Encoding successful! Output file: $OUTPUT_HEVC"
else
echo "Encoding failed!"
fi
# Clean up
rm -f $RAW_YUV
echo "Done."

0 comments on commit 4a36583

Please sign in to comment.