[ / / / / / / / / / / / / / ] [ dir / animu / cafechan / eris / g / tingles / vg / vichan / vietnam ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Email
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 96e5bd1624ccb3e⋯.png (1.14 MB, 2400x3420, 40:57, 1.01.png) (h) (u)

[–]

 No.1007429>>1007430 >>1007442 >>1007443 >>1007478 [Watch Thread][Show All Posts]

Is this guide /tech/ approved?

How are you supposed to find new commands to fiddle around with in FFmpeg? It's some arcane shit I tell you.

 No.1007430>>1007442

>>1007429 (OP)

man ffmpeg


 No.1007431

>vp8


 No.1007442>>1007443 >>1007463

>>1007429 (OP)

>https://trac.ffmpeg.org/wiki/Encode/VP9

First link for "ffmpeg webm" in startpage. You're a retarded niggerfaggot.

>>1007430

>man ffmpeg

You meant ffmpeg-codec, right?


 No.1007443>>1007455 >>1007477

>>1007429 (OP)

Shit guide.

>>1007442

That one is okay but here is one with all flags optimal right out of the box:

Section Constant Quality Recommended Settings in http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide


 No.1007455>>1007473 >>1007477

>>1007443

Nah, it's a bad guide, the "best" section is the equivalent of the placebo preset for x264. Personally, I use


ffmpeg -i "$1" -ss "$sdur" -t "$dur" -map 0:v:0 -map 0:a:$astream? \
-c:v libvpx-vp9 -auto-alt-ref 1 -lag-in-frames 25 -speed 1 -tile-columns 2 \
-threads 2 -b:v $vrate -pix_fmt yuv420p \
-c:a libopus -ac 2 -b:a $arate \
-vf "$filterchain" -sn -pass 1 -f webm -y /dev/null

The real advice to give is: make sure you use the latest libvpx, because the improvements are massive.


 No.1007463

File (hide): 39e68ae4b1780a0⋯.jpg (54.46 KB, 484x483, 484:483, 121534678.jpg) (h) (u)

>>1007442

I just wanted some opinions here. Chill.


 No.1007473>>1007482

>>1007455

>the "best" section is the equivalent of the placebo preset for x264

Not exactly. It is slow but it also prevents quantization from jumping all over the place.

#!/usr/bin/env sh

trap finish 1 2 14 15

finish ()
{
command rm -f -- "${PASSLOG}-0.log"
unset encode error finish help \
INPUT LOSSLESS NAME OPTARG OUTPUT OVERWRITE PASSLOG QUALITY THREADS TMP0 TMP1
exit $1
}

help ()
{
command cat << EOF
USAGE: $NAME [OPTION]... INPUT [OUTPUT]
Encode a video with VP9 codec using FFmpeg.

OPTIONS:
-h : display this help and exit
-q : set the encoding quality
between 0 and 63, 0 is lossless, default is 30
-t : set the number of threads to use
-f : do not prompt before overwriting
EOF
finish
}

error ()
{
printf "%s: %s -- '%s'\n" "$NAME" "$1" "$OPTARG" >&2
finish 1
}

encode ()
{
printf 'Pass #%d...\n' $1
case "$1" in
1) TMP0='-y'
TMP1='/dev/null'
;;
2) TMP0="$OVERWRITE"
TMP1="$OUTPUT"
;;
esac
command ffmpeg -v error -stats $TMP0 \
-i "$INPUT" -map 0:v:0 -map_chapters -1 -map_metadata -1 \
-sws_flags lanczos+accurate_rnd+full_chroma_int+bitexact \
-c:v libvpx-vp9 -b:v 0 -auto-alt-ref 1 -lag-in-frames 25 \
-tile-columns 0 -frame-parallel 0 -aq-mode none -row-mt 1 \
-cpu-used 0 -deadline best \
-threads $THREADS -crf $QUALITY -lossless $LOSSLESS \
-pass $1 -passlogfile "$PASSLOG" -f ivf -bitexact -- "$TMP1"
return $?
}

NAME="`basename -- "$0"`"
THREADS=`grep -c ^processor /proc/cpuinfo`
QUALITY=30
LOSSLESS=0

while getopts hfq:t: TMP0; do
case "$TMP0" in
h) help ;;
f) OVERWRITE='-y' ;;
q) case "$OPTARG" in
0) QUALITY=0
LOSSLESS=1
;;
[1-9]|[1-5][0-9]|6[0-3])
QUALITY=$OPTARG
;;
*) error 'incorrect encoding quality' ;;
esac
;;
t) case "$OPTARG" in
[1-9]|[1-9][0-9])
if [ $OPTARG -gt $THREADS ]; then
error 'not enough CPU cores'
else
THREADS=$OPTARG
fi
;;
*) error 'incorrect number of threads' ;;
esac
;;
esac
done
shift $((OPTIND-1))
unset TMP0 OPTARG

if [ -z "$1" ]; then
help
else
INPUT="$1"
fi
if [ -z "$2" ]; then
OUTPUT="${INPUT%.*}.ivf"
else
OUTPUT="$2"
fi
PASSLOG="`basename -- "$OUTPUT"`"
PASSLOG="${XDG_CACHE_HOME:-/tmp}/${PASSLOG%.*}"

encode 1 && encode 2

finish $?


 No.1007477

>>1007455

>"best" section

I did refer solely to the Constant Quality Recommended Settings

see >>1007443


 No.1007478

>>1007429 (OP)

They have some good stuff at >>>/webm/


 No.1007482

>>1007473

Pretty okay script (but don't use backticks, they're horrible to nest). Here's mine: https://repo.or.cz/q3cpma-shell-scripts.git/blob/HEAD:/webm.sh


 No.1007494

>How are you supposed to find new commands to fiddle around with in FFmpeg?

QTDDTOT

>>>/g/

RTFM

pick one

start off small and develop your own script as you go.

My current incantation is over 300 loc, calculates bit rates, and formats automatically, and plays a tune when finished.




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
11 replies | 1 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / animu / cafechan / eris / g / tingles / vg / vichan / vietnam ][ watchlist ]