research pipelines
This commit is contained in:
parent
d3ce6e0eef
commit
11096da4e3
17
ffmpeg-psnr-check.sh
Normal file → Executable file
17
ffmpeg-psnr-check.sh
Normal file → Executable file
@ -1,23 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "$#" -ne 2 ]; then
|
|
||||||
echo "Usage: $0 <input_video> <reference_video>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v ffmpeg &> /dev/null
|
if ! command -v ffmpeg &> /dev/null
|
||||||
then
|
then
|
||||||
echo "ffmpeg could not be found, please install it."
|
echo "ffmpeg could not be found, please install it."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
name=nvv4l2h264enc
|
||||||
|
specific=eleph-pr-baseline-preset1-cbr-hqp-10
|
||||||
|
|
||||||
|
#
|
||||||
#this script checks the PSNR between two video streams using ffmpeg
|
#this script checks the PSNR between two video streams using ffmpeg
|
||||||
# one video stream is the reference and the other is the test stream both are recorded files
|
# one video stream is the reference and the other is the test stream both are recorded files
|
||||||
ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv444p -color_range pc -framerate 30 -i "$1" -i "$2" -filter_complex "psnr" -f null /dev/null
|
ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv420p -color_range tv -framerate 60 -i base-${name}-${specific}.yuv -i encoded-${name}-${specific}.mp4 -filter_complex "psnr" -f null /dev/null
|
||||||
# example working:
|
# example working:
|
||||||
# ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv444p -color_range pc -framerate 30 -i base.yuv -i test.mp4 -filter_complex "psnr" -f null /dev/null
|
# ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv420p -color_range tv -framerate 60 -i base-${name}-${specific}.yuv -i encoded-${name}-${specific}.mp4 -filter_complex "psnr" -f null /dev/null
|
||||||
|
# ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format nv12 -color_range tv -framerate 60 -i base-${name}-${specific}.yuv -i encoded-${name}-${specific}.mp4 -filter_complex "psnr" -f null /dev/null
|
||||||
|
# ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv420p -color_range pc -framerate 60 -i base.yuv -i test.mp4 -filter_complex "psnr" -f null /dev/null
|
||||||
|
|
||||||
#this script checks the SSIM between two video streams using ffmpeg
|
#this script checks the SSIM between two video streams using ffmpeg
|
||||||
ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv444p -color_range pc -framerate 30 -i "$1" -i "$2" -filter_complex "[0:v][1:v]ssim=stats_file=ssim_results.txt" -f null /dev/null
|
ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv420p -color_range tv -framerate 60 -i base-${name}-${specific}.yuv -i encoded-${name}-${specific}.mp4 -filter_complex "[0:v]fps=60[v0];[1:v]fps=60[v1];[v0][v1]ssim=stats_file=ssim_results.txt" -f null /dev/null
|
||||||
|
|
||||||
# ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv422p -color_range pc -framerate 30 -i base.yuv -i test.mp4 -filter_complex "[0:v][1:v]ssim=stats_file=ssim_results.txt" -f null /dev/null
|
# ffmpeg -f rawvideo -video_size 1920x1080 -pixel_format yuv422p -color_range pc -framerate 30 -i base.yuv -i test.mp4 -filter_complex "[0:v][1:v]ssim=stats_file=ssim_results.txt" -f null /dev/null
|
||||||
@ -5,34 +5,58 @@
|
|||||||
# First stream is coming from decklinkvideosrc
|
# First stream is coming from decklinkvideosrc
|
||||||
# Second stream is same decklinkvideosrc but encoded using x264enc
|
# Second stream is same decklinkvideosrc but encoded using x264enc
|
||||||
# Both streams are saved to files using mp4mux and filesink
|
# Both streams are saved to files using mp4mux and filesink
|
||||||
|
|
||||||
if [ "$#" -lt 2 ]; then
|
|
||||||
echo "Usage: $0 <reference_video_file> <test_video_file> <optional: DEBUG>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v gst-launch-1.0 &> /dev/null
|
if ! command -v gst-launch-1.0 &> /dev/null
|
||||||
then
|
then
|
||||||
echo "gstreamer could not be found, please install it."
|
echo "gstreamer could not be found, please install it."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Record both streams in one run
|
src='decklinkvideosrc device-number=1 connection=1 mode=1080p60 drop-no-signal-frames=true !'
|
||||||
if [ "$3" == "DEBUG" ]; then
|
|
||||||
gst-launch-1.0 -e \
|
if [ "$1" == "DEBUG" ]; then
|
||||||
videotestsrc pattern=smpte ! \
|
src='videotestsrc pattern=smpte !'
|
||||||
capsfilter caps="video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1" ! \
|
|
||||||
videoconvert ! queue ! tee name=t \
|
|
||||||
t. ! queue ! filesink location="$1" \
|
|
||||||
t. ! queue ! x264enc bitrate=20000 speed-preset=ultrafast tune=zerolatency ! h264parse ! mpegtsmux ! filesink location="$2"
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gst-launch-1.0 -e \
|
name=nvv4l2h264enc
|
||||||
decklinkvideosrc \
|
specific=eleph-pr-baseline-preset1-cbr-lossless-10
|
||||||
device-number=1 \
|
|
||||||
connection=1 \
|
echo $src
|
||||||
mode=auto \
|
|
||||||
drop-no-signal-frames=true ! videoconvert ! queue ! tee name=t \
|
GST_DEBUG_COLOR_MODE=off \
|
||||||
t. ! queue ! mpegtsmux ! filesink location="$1" \
|
GST_TRACERS="latency(flags=pipeline+element)" \
|
||||||
t. ! queue ! x264enc bitrate=20000 speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! filesink location="$2"
|
GST_DEBUG="GST_TRACER:7" \
|
||||||
|
GST_DEBUG_FILE=latency_traces-${name}-${specific}.log \
|
||||||
|
gst-launch-1.0 -e \
|
||||||
|
$src \
|
||||||
|
capsfilter caps="video/x-raw,format=UYVY,width=1920,height=1080,framerate=60/1" ! \
|
||||||
|
videoconvert ! capsfilter caps="video/x-raw,format=I420,width=1920,height=1080,framerate=60/1" ! queue ! tee name=t \
|
||||||
|
t. ! queue ! filesink location="base-${name}-${specific}.yuv" \
|
||||||
|
t. ! queue ! nvvideoconvert ! \
|
||||||
|
capsfilter caps="video/x-raw(memory:NVMM),format=I420,width=1920,height=1080" ! \
|
||||||
|
${name} bitrate=10000000 profile=0 preset-id=1 control-rate=1 tuning-info-id=4 ! \
|
||||||
|
capsfilter caps="video/x-h264,profile=baseline" ! h264parse ! mpegtsmux ! filesink location="encoded-${name}-${specific}.mp4"
|
||||||
|
|
||||||
|
|
||||||
|
# GST_DEBUG_COLOR_MODE=off \
|
||||||
|
# GST_TRACERS="latency(flags=pipeline+element)" \
|
||||||
|
# GST_DEBUG="GST_TRACER:7" \
|
||||||
|
# GST_DEBUG_FILE=latency_traces-${name}-${specific}.log \
|
||||||
|
# gst-launch-1.0 -e \
|
||||||
|
# $src \
|
||||||
|
# capsfilter caps="video/x-raw,format=UYVY,width=1920,height=1080,framerate=60/1" ! \
|
||||||
|
# videoconvert ! queue ! tee name=t \
|
||||||
|
# t. ! queue ! filesink location="base-${name}-${specific}.yuv" \
|
||||||
|
# t. ! queue ! x264enc bitrate=10000 speed-preset=ultrafast tune=zerolatency sliced-threads=true ! \
|
||||||
|
# capsfilter caps="video/x-h264,profile=baseline" ! h264parse ! mpegtsmux ! filesink location="encoded-${name}-${specific}.mp4"
|
||||||
|
|
||||||
|
# GST_DEBUG_COLOR_MODE=off \
|
||||||
|
# GST_TRACERS="latency(flags=pipeline+element)" \
|
||||||
|
# GST_DEBUG="GST_TRACER:7" \
|
||||||
|
# GST_DEBUG_FILE=latency_traces-${name}-${specific}.log \
|
||||||
|
# gst-launch-1.0 -e \
|
||||||
|
# $src \
|
||||||
|
# capsfilter caps="video/x-raw,format=UYVY,width=1920,height=1080,framerate=60/1" ! \
|
||||||
|
# videoconvert ! capsfilter caps="video/x-raw,format=NV12,width=1920,height=1080,framerate=60/1" ! queue ! tee name=t \
|
||||||
|
# t. ! queue ! filesink location="base-${name}-${specific}.yuv" \
|
||||||
|
# t. ! queue ! ${name} bitrate=10000 preset=5 rc-lookahead=0 rc-mode=2 zerolatency=true ! \
|
||||||
|
# capsfilter caps="video/x-h264,profile=baseline" ! h264parse ! mpegtsmux ! filesink location="encoded-${name}-${specific}.mp4"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user