diff --git a/pts/ffmpeg-7.1.0/downloads.xml b/pts/ffmpeg-7.1.0/downloads.xml new file mode 100644 index 00000000..eb68a62b --- /dev/null +++ b/pts/ffmpeg-7.1.0/downloads.xml @@ -0,0 +1,34 @@ + + + + + + http://ffmpeg.org/releases/ffmpeg-7.0.tar.xz + d2edfc6ec6494c432828876e3102f740 + 4426a94dd2c814945456600c8adfc402bee65ec14a70e8c531ec9a2cd651da7b + ffmpeg-7.0.tar.xz + 10791240 + + + https://code.videolan.org/videolan/x264/-/archive/7ed753b10a61d0be95f683289dfb925b800b0676/x264-7ed753b10a61d0be95f683289dfb925b800b0676.zip + dec93f9a2fd2a91afff1e9d5fb2fea54 + 48b9160177774f3efd29a60d722d9eddd6c023c0904a9a4f83377aa6e6845edb + x264-7ed753b10a61d0be95f683289dfb925b800b0676.zip + 1222728 + + + https://bitbucket.org/multicoreware/x265_git/downloads/x265_3.6.tar.gz + 99997ecc8ee4d3575ba7715c759ad3bb + 663531f341c5389f460d730e62e10a4fcca3428ca2ca109693867bc5fe2e2807 + x265_3.6.tar.gz + 1655889 + + + http://arcade.cs.columbia.edu/vbench/data/vbench.zip + f7f5217fbcaabc17363d99a1559800f8 + c34b873a18b151322483ca460fcf9ed6a5dbbc2bb74934c57927b88ee1de3472 + vbench-01.zip + 874958969 + + + diff --git a/pts/ffmpeg-7.1.0/install.sh b/pts/ffmpeg-7.1.0/install.sh new file mode 100644 index 00000000..bbb46c11 --- /dev/null +++ b/pts/ffmpeg-7.1.0/install.sh @@ -0,0 +1,213 @@ +#!/bin/sh + +tar -xf ffmpeg-7.0.tar.xz +unzip -o x264-7ed753b10a61d0be95f683289dfb925b800b0676.zip +tar -xf x265_3.6.tar.gz +mkdir ffmpeg_/ + +INSTALL_FOLDER=$(pwd) + +export PKG_CONFIG_PATH="$INSTALL_FOLDER/ffmpeg_/lib/pkgconfig" +cd "$INSTALL_FOLDER/x264-7ed753b10a61d0be95f683289dfb925b800b0676" || exit 69 +./configure --prefix="$INSTALL_FOLDER/ffmpeg_/" --enable-static --enable-lto --enable-pic +make -j "$NUM_CPU_CORES" +make install + +cd "$INSTALL_FOLDER/x265_3.6/build" || exit 69 +cmake ../source/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$INSTALL_FOLDER/ffmpeg_/" +make -j "$NUM_CPU_CORES" +make install + +cd "$INSTALL_FOLDER" || exit 69 +cat > ffmpeg_/lib/pkg-config/x265.pc << EOF +exec_prefix=\${prefix} +libdir=\${exec_prefix}/lib +includedir=\${prefix}/include + +Name: x265 +Description: H.265/HEVC video encoder +Version: 3.6 +Libs: -L\${libdir} -lx265 +Libs.private: -lstdc++ -lm -lgcc_s -lgcc -lgcc_s -lgcc -lrt -ldl -lnuma +Cflags: -I\${includedir} +EOF + + +cd "$INSTALL_FOLDER/ffmpeg-7.0/" || exit 69 +./configure --disable-zlib --disable-doc --prefix="$INSTALL_FOLDER/ffmpeg_/" --extra-cflags="-I$INSTALL_FOLDER/ffmpeg_/include" --extra-ldflags="-L$INSTALL_FOLDER/ffmpeg_/lib -ldl" --bindir="$INSTALL_FOLDER/ffmpeg_/bin" --pkg-config-flags="--static" --enable-gpl --enable-libx264 --enable-libx265 +make -j "$NUM_CPU_CORES" +echo $? > "$INSTALL_FOLDER/install-exit-status" +make install +cd "$INSTALL_FOLDER" || exit 69 +rm -rf ffmpeg-7.0/ + +unzip -o vbench-01.zip +cd vbench/code || exit 69 +patch -p0 <<'EOF' +diff -Naur reference.py.orig reference.py +--- reference.py.orig 2021-03-21 17:47:18.000000000 -0400 ++++ reference.py 2022-10-30 13:36:31.346904399 -0400 +@@ -13,7 +13,7 @@ + p = subprocess.Popen(cmd,stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True) + out, err = p.communicate() + +- m = re.search("average:([0-9]+\.[0-9]+)",err) ++ m = re.search("average:([0-9]+\.[0-9]+)",err.decode('utf-8')) + + # cleanup + try: +@@ -22,7 +22,7 @@ + pass + + if m is None: +- m = re.search("average:(inf)",err) ++ m = re.search("average:(inf)",err.decode('utf-8')) + assert m is not None + return 100.0 + else: +@@ -34,7 +34,7 @@ + p = subprocess.Popen(cmd,stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + +- m = re.search("bitrate: ([0-9]+) kb/s",err) ++ m = re.search("bitrate: ([0-9]+) kb/s",err.decode('utf-8')) + assert m is not None + return int(m.group(1))*1000 #report in b/s + +@@ -45,24 +45,29 @@ + cmd = [ffprobe,"-show_entries","stream=width,height",video] + p = subprocess.Popen(cmd,stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() +- + # grep resolution +- width = re.search("width=([0-9]+)",out) ++ width = re.search("width=([0-9]+)",out.decode('utf-8')) + assert width is not None, "Problem in fetching video width with {} on {}".format(ffprobe,video) +- height = re.search("height=([0-9]+)",out) ++ height = re.search("height=([0-9]+)",out.decode('utf-8')) + assert height is not None, "Problem in fetching video height with {} on {}".format(ffprobe,video) + resolution = int( width.group(1) ) * int( height.group(1) ) + + # grep framerate +- frame = re.search("([0-9\.]+) fps",err) ++ frame = re.search("([0-9\.]+) fps",err.decode('utf-8')) + assert frame is not None, "Problem in fetching framerate with {} on {}".format(ffprobe,video) + framerate = float(frame.group(1)) + +- return resolution, framerate ++ cmd = [ffprobe,"-select_streams", "v:0", "-count_frames", "-show_entries", "stream=nb_read_frames",video] ++ p = subprocess.Popen(cmd,stdout=subprocess.PIPE, stderr=subprocess.PIPE) ++ out, err = p.communicate() ++ num_frames = re.search("nb_read_frames=([0-9]+)",out.decode('utf-8')) ++ frame_count = int(num_frames.group(1)) ++ ++ return resolution, framerate, frame_count + +-def encode(ffmpeg, video, settings, output): ++def encode(ffmpeg, video, settings, output, encoder): + ''' perform the transcode operation using ffmpeg ''' +- cmd = [ffmpeg,"-i",video,"-c:v","libx264","-threads",str(1)]+settings+["-y",output] ++ cmd = [ffmpeg,"-i",video,"-c:v",encoder,"-threads",str(1)]+settings+["-y",output] + start = timer() + p = subprocess.Popen(cmd,stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() +@@ -70,10 +75,10 @@ + + return elapsed + +-def encode_2pass(ffmpeg, video, settings, output_file): ++def encode_2pass(ffmpeg, video, settings, output_file, encoder): + ''' perform two pass transcoding ''' +- time_to_encode1 = encode(ffmpeg, video, ["-pass", str(1) ,"-f", "null", "-an", "-sn"]+settings, "/dev/null") +- time_to_encode2 = encode(ffmpeg, video, ["-pass", str(2)]+settings, output_file) ++ time_to_encode1 = encode(ffmpeg, video, ["-pass", str(1) ,"-f", "null", "-an", "-sn"]+settings, "/dev/null", encoder) ++ time_to_encode2 = encode(ffmpeg, video, ["-pass", str(2)]+settings, output_file, encoder) + + return time_to_encode1+time_to_encode2 + +@@ -89,6 +94,8 @@ + help="Transcoding scenario") + parser.add_argument("--output_dir", type=str,default="/tmp", + help="Where to save transcoded videos") ++ parser.add_argument("--encoder", type=str,default="libx264", ++ help="FFmpeg encoder to use") + parser.add_argument("--ffmpeg_dir", type=str, + default=os.path.join(vbench_root,"code/bin"), + help="Path to ffmpeg installation folder") +@@ -106,6 +113,7 @@ + else: + video_dir = os.path.join(os.getenv("VBENCH_ROOT"),"videos/crf18") + ++ ffmpeg_encoder = args.encoder + ffmpeg = os.path.join(args.ffmpeg_dir, "ffmpeg") + ffprobe = os.path.join(args.ffmpeg_dir, "ffprobe") + assert(os.path.isfile(ffmpeg) and os.access(ffmpeg, os.X_OK)), \ +@@ -129,7 +137,9 @@ + # perform transcoding + ############################################### + +- print "# video_name, transcoding time, psnr compared to original, transcode bitrate" ++ print("# video_name, transcoding time, psnr compared to original, transcode bitrate") ++ total_elapsed = 0 ++ total_frames = 0 + for v_name in input_files: + video = os.path.join(video_dir, v_name) + +@@ -138,10 +148,12 @@ + + if args.scenario == "upload": + settings = [ "-crf","18" ] +- elapsed = encode(ffmpeg,video,settings,output_video) ++ resolution, framerate, num_frames = get_video_stats(ffprobe, video) ++ elapsed = encode(ffmpeg,video,settings,output_video, ffmpeg_encoder) + else: + # get stats of the video and use to compute target_bitrate +- resolution, framerate = get_video_stats(ffprobe, video) ++ resolution, framerate, num_frames = get_video_stats(ffprobe, video) ++ total_frames += num_frames + + # fixed number of bits per pixel as target bitrate + if framerate > 30: +@@ -163,13 +175,15 @@ + else: + settings += [ "-preset","veryfast","-tune","zerolatency" ] + +- elapsed = encode(ffmpeg,video,settings,output_video) ++ elapsed = encode(ffmpeg,video,settings,output_video, ffmpeg_encoder) + elif args.scenario in ["vod","platform"]: + settings += [ "-preset","medium" ] +- elapsed = encode_2pass(ffmpeg, video, settings, output_video) ++ elapsed = encode_2pass(ffmpeg, video, settings, output_video, ffmpeg_encoder) ++ num_frames *= 2 + elif args.scenario == "popular": + settings += [ "-preset","veryslow" ] +- elapsed = encode_2pass(ffmpeg, video, settings, output_video) ++ elapsed = encode_2pass(ffmpeg, video, settings, output_video, ffmpeg_encoder) ++ num_frames *= 2 + else: + raise NotImplementedError + +@@ -177,7 +191,13 @@ + psnr = get_psnr(ffmpeg, output_video, video) + transcode_bitrate = get_bitrate(ffprobe, output_video) + +- print "{},{},{},{}".format(v_name, elapsed, psnr, transcode_bitrate) ++ print("{},{},{},{}".format(v_name, elapsed, psnr, transcode_bitrate)) ++ total_elapsed += elapsed ++ total_frames += num_frames ++ ++ print("Total Elaped Time (s): {}".format(total_elapsed)) ++ print("Total Frames: {}".format(total_frames)) ++ print("Average FPS: {}".format(total_frames / total_elapsed)) + + # cleanup + try: +EOF + +cd "$INSTALL_FOLDER" || exit 69 +echo "#!/bin/sh +cd vbench/code +export LD_LIBRARY_PATH=\$INSTALL_FOLDER/ffmpeg_/lib/:\$LD_LIBRARY_PATH +VBENCH_ROOT=\$INSTALL_FOLDER/vbench/ python3 reference.py --ffmpeg_dir=\$INSTALL_FOLDER/ffmpeg_/bin/ \$@ > \$LOG_FILE 2>&1 +echo \$? > $INSTALL_FOLDER/test-exit-status" > ffmpeg +chmod +x ffmpeg diff --git a/pts/ffmpeg-7.1.0/results-definition.xml b/pts/ffmpeg-7.1.0/results-definition.xml new file mode 100644 index 00000000..1b5b53a1 --- /dev/null +++ b/pts/ffmpeg-7.1.0/results-definition.xml @@ -0,0 +1,9 @@ + + + + + Average FPS: #_RESULTS_# + FPS + HIB + + diff --git a/pts/ffmpeg-7.1.0/test-definition.xml b/pts/ffmpeg-7.1.0/test-definition.xml new file mode 100644 index 00000000..cb4a08ae --- /dev/null +++ b/pts/ffmpeg-7.1.0/test-definition.xml @@ -0,0 +1,69 @@ + + + + + FFmpeg + 7.0 + This is a benchmark of the FFmpeg multimedia framework. The FFmpeg test profile is making use of a modified version of vbench from Columbia University's Architecture and Design Lab (ARCADE) [http://arcade.cs.columbia.edu/vbench/] that is a benchmark for video-as-a-service workloads. The test profile offers the options of a range of vbench scenarios based on freely distributable video content and offers the options of using the x264 or x265 video encoders for transcoding. + FPS + HIB + 3 + + + 7.1.0 + Linux + Utility + Processor + Free + Verified + build-utilities, yasm, nasm, python, cmake, libnuma-dev + 1300 + https://ffmpeg.org/ + https://github.com/FFmpeg/FFmpeg + Michael Larabel + pkg-config + + + + + +