-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathffmpeg-hdr-to-sdr
More file actions
executable file
·36 lines (24 loc) · 874 Bytes
/
ffmpeg-hdr-to-sdr
File metadata and controls
executable file
·36 lines (24 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -euo pipefail
run() {
echo >&2 "+ $*"
"$@"
}
if [ $# -lt 2 ] || [ $# -gt 2 ]; then
cat >&2 <<EOM
usage: $(basename "$0") INPUT OUTPUT
Convert HDR video to standard def using zscale tone mapping.
I cargo culted these options, so I have no idea if this is the recommended way
to do this. The video snobs on the internet suggest just going back in time and
recording in SDR instead as the better way, or going forward in time and using
a player that supports HDR instead.
Original purpose: convert HDR iOS videos to SDR for use with 1SE on Android.
For example:
$(basename "$0") IMG_1234.MOV out.mp4
EOM
exit 1
fi
input="$1"
output="$2"
run ffmpeg -i "$input" -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p "$output"
echo "Successfully wrote $output"