1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

tests/fate: add a simple test for libx264

Since this is an external encoder not under our control, we cannot test
the encoded output exactly as is done for internal encoders. We can
still test however that the output is decodable and produces the
expected number of frames with expected dimensions, pixel formats, and
timestamps.
This commit is contained in:
Anton Khirnov 2023-03-11 17:54:46 +01:00
parent f618004bc1
commit 2953ebe7b6
4 changed files with 108 additions and 0 deletions

View File

@ -177,6 +177,7 @@ include $(SRC_PATH)/tests/fate/dpcm.mak
include $(SRC_PATH)/tests/fate/dvvideo.mak
include $(SRC_PATH)/tests/fate/ea.mak
include $(SRC_PATH)/tests/fate/exif.mak
include $(SRC_PATH)/tests/fate/enc_external.mak
# Must be included after lavf-video.mak
include $(SRC_PATH)/tests/fate/ffmpeg.mak
include $(SRC_PATH)/tests/fate/ffprobe.mak

View File

@ -282,6 +282,22 @@ stream_remux(){
run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tencfile || return
}
# this function is for testing external encoders,
# where the precise output is not controlled by us
# we can still test e.g. that the output can be decoded correctly
enc_external(){
srcfile=$1
enc_fmt=$2
enc_opt=$3
probe_opt=$4
srcfile=$(target_path $srcfile)
encfile=$(target_path "${outdir}/${test}.${enc_fmt}")
ffmpeg -i $srcfile $enc_opt -f $enc_fmt -y $encfile || return
run ffprobe${PROGSUF}${EXECSUF} -bitexact $probe_opt $encfile || return
}
# FIXME: There is a certain duplication between the avconv-related helper
# functions above and below that should be refactored.
ffmpeg2="$target_exec ${target_path}/ffmpeg${PROGSUF}${EXECSUF}"

View File

@ -0,0 +1,6 @@
FATE_ENC_EXTERNAL-$(call ENCDEC, LIBX264 H264, MOV, H264_DEMUXER) += fate-libx264-simple
fate-libx264-simple: CMD = enc_external $(TARGET_SAMPLES)/h264-conformance/BA1_Sony_D.jsv \
mp4 "-c:v libx264" "-show_entries frame=width,height,pix_fmt,pts,pkt_dts -of flat"
FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_ENC_EXTERNAL-yes)
fate-enc-external: $(FATE_ENC_EXTERNAL-yes)

View File

@ -0,0 +1,85 @@
frames.frame.0.pts=0
frames.frame.0.pkt_dts=0
frames.frame.0.width=176
frames.frame.0.height=144
frames.frame.0.pix_fmt="yuv420p"
frames.frame.1.pts=512
frames.frame.1.pkt_dts=512
frames.frame.1.width=176
frames.frame.1.height=144
frames.frame.1.pix_fmt="yuv420p"
frames.frame.2.pts=1024
frames.frame.2.pkt_dts=1024
frames.frame.2.width=176
frames.frame.2.height=144
frames.frame.2.pix_fmt="yuv420p"
frames.frame.3.pts=1536
frames.frame.3.pkt_dts=1536
frames.frame.3.width=176
frames.frame.3.height=144
frames.frame.3.pix_fmt="yuv420p"
frames.frame.4.pts=2048
frames.frame.4.pkt_dts=2048
frames.frame.4.width=176
frames.frame.4.height=144
frames.frame.4.pix_fmt="yuv420p"
frames.frame.5.pts=2560
frames.frame.5.pkt_dts=2560
frames.frame.5.width=176
frames.frame.5.height=144
frames.frame.5.pix_fmt="yuv420p"
frames.frame.6.pts=3072
frames.frame.6.pkt_dts=3072
frames.frame.6.width=176
frames.frame.6.height=144
frames.frame.6.pix_fmt="yuv420p"
frames.frame.7.pts=3584
frames.frame.7.pkt_dts=3584
frames.frame.7.width=176
frames.frame.7.height=144
frames.frame.7.pix_fmt="yuv420p"
frames.frame.8.pts=4096
frames.frame.8.pkt_dts=4096
frames.frame.8.width=176
frames.frame.8.height=144
frames.frame.8.pix_fmt="yuv420p"
frames.frame.9.pts=4608
frames.frame.9.pkt_dts=4608
frames.frame.9.width=176
frames.frame.9.height=144
frames.frame.9.pix_fmt="yuv420p"
frames.frame.10.pts=5120
frames.frame.10.pkt_dts=5120
frames.frame.10.width=176
frames.frame.10.height=144
frames.frame.10.pix_fmt="yuv420p"
frames.frame.11.pts=5632
frames.frame.11.pkt_dts=5632
frames.frame.11.width=176
frames.frame.11.height=144
frames.frame.11.pix_fmt="yuv420p"
frames.frame.12.pts=6144
frames.frame.12.pkt_dts=6144
frames.frame.12.width=176
frames.frame.12.height=144
frames.frame.12.pix_fmt="yuv420p"
frames.frame.13.pts=6656
frames.frame.13.pkt_dts=6656
frames.frame.13.width=176
frames.frame.13.height=144
frames.frame.13.pix_fmt="yuv420p"
frames.frame.14.pts=7168
frames.frame.14.pkt_dts=7168
frames.frame.14.width=176
frames.frame.14.height=144
frames.frame.14.pix_fmt="yuv420p"
frames.frame.15.pts=7680
frames.frame.15.pkt_dts="N/A"
frames.frame.15.width=176
frames.frame.15.height=144
frames.frame.15.pix_fmt="yuv420p"
frames.frame.16.pts=8192
frames.frame.16.pkt_dts="N/A"
frames.frame.16.width=176
frames.frame.16.height=144
frames.frame.16.pix_fmt="yuv420p"