mdhiggins / sickbeard_mp4_automator

Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
MIT License
1.51k stars 201 forks source link

How to set different allowed bit depths for x264 and x265 #1385

Closed eikowagenknecht closed 3 years ago

eikowagenknecht commented 3 years ago

I'm using the LG Plex app and until today my knowledge was that 10bit playback is not supported at all. Because of that I reencoded all my files to 8bit so that no transcoding is needed on playback.

But today I discovered that 10bit is supported for hevc / x265, so the new list is:

Is there any possibility to set the autoprocess.ini in a way that only the 10 bit x264 files are reencoded?

My current configuration is:

[Universal Audio]
first-stream-only = False
filter = 
channel-bitrate = 128
codec = aac
move-after = False
force-filter = False

[Audio]
default-more-channels = True
copy-original = False
ignore-truehd = mp4, m4v
prefer-more-channels = True
default-language = eng
max-channels = 0
filter = 
max-bitrate = 0
first-stream-of-language = True
languages = eng,deu
sample-rates = 
codec = ac3,aac,mp3
allow-language-relax = True
channel-bitrate = 128
aac-adtstoasc = False
force-filter = False
ignored-dispositions = 
unique-dispositions = False

[Subtitle]
embed-image-subs = False
embed-subs = True
codec-image-based = 
encoding = 
embed-only-internal-subs = False
filename-dispositions = forced
download-providers = 
first-stream-of-language = False
languages = eng
codec = mov_text
burn-dispositions = 
attachment-codec = 
ignore-embedded-subs = False
burn-subtitles = False
download-hearing-impaired-subs = False
default-language = eng
download-subs = True
ignored-dispositions = 
unique-dispositions = True

[Converter]
postopts = 
hwaccel-decoders = h264_vaapi, hevc_vaapi, mjpeg_vaapi, mpeg2_vaapi, vp8_vaapi, vp9_vaapi
post-process = False
ignored-extensions = nfo, ds_store
temp-extension = 
ffmpeg = /usr/local/bin/ffmpeg
preopts = 
minimum-size = 0
delete-original = True
ffprobe = /usr/local/bin/ffprobe
force-convert = False
output-extension = mp4
hwaccels = vaapi
output-directory = 
process-same-extensions = False
threads = 0
move-to = 
copy-to = 
output-format = mp4
sort-streams = True
detailed-progress = True
hwdevices = vaapi:/dev/dri/renderD128
hwaccel-output-format = vaapi:vaapi
wait-post-process = False
bypass-if-copying-all = False

[Deluge]
username = 
sonarr-label = sonarr
host = localhost
radarr-label = radarr
password = 
port = 58846
convert = True
sickbeard-label = sickbeard
remove = False
couchpotato-label = couchpotato
output-directory = 
bypass-label = bypass
sickrage-label = sickrage
path-mapping = 

[uTorrent]
username = 
convert = True
password = 
output-directory = 
sonarr-label = sonarr
sickbeard-label = sickbeard
couchpotato-label = couchpotato
port = 8080
ssl = False
host = localhost
radarr-label = radarr
webui = False
action-before = 
bypass-label = bypass
action-after = 
sickrage-label = sickrage
path-mapping = 

[Radarr]
ssl = False
host = 127.0.0.1
apikey = 43f3d35f43d843fea7ecce63e6630987
port = 7878
webroot = 
force-rename = False

[Sickbeard]
username = 
apikey = 
webroot = 
ssl = False
host = localhost
password = 
port = 8081

[qBittorrent]
username = 
sonarr-label = sonarr
ssl = False
host = localhost
radarr-label = radarr
couchpotato-label = couchpotato
port = 8080
convert = True
password = 
sickbeard-label = sickbeard
action-after = 
output-directory = 
action-before = 
bypass-label = bypass
sickrage-label = sickrage
path-mapping = 

[Sickrage]
username = 
apikey = 
webroot = 
ssl = False
host = localhost
password = 
port = 8081

[Plex]
token = 
host = localhost
port = 32400
refresh = False

[CouchPotato]
username = 
delay = 65
host = localhost
apikey = 
webroot = 
ssl = False
password = 
delete-failed = False
port = 5050
method = renamer

[Sonarr]
ssl = False
host = 127.0.0.1
apikey = 5aaa7664d5cb4ba1bd7693980f35c7ac
port = 8989
webroot = 
force-rename = False

[Video]
profile = 
crf-profiles = 0:23:5M:15M,4000:23:10M:24M,8000:23:20M:60M
codec = h265vaapi, hevc, h265, x265, x264, h264
crf = -1
max-width = 0
max-bitrate = 0
pix-fmt = nv12, yuv420p
max-level = 0.0
filter = 
force-filter = False
codec-parameters = 
preset = 
dynamic-parameters = False

[SABNZBD]
output-directory = 
convert = True
sickrage-category = sickrage
radarr-category = radarr
sonarr-category = sonarr
bypass-category = bypass
couchpotato-category = couchpotato
sickbeard-category = sickbeard
path-mapping = 

[Metadata]
download-artwork = True
relocate-moov = True
full-path-guess = True
tag = True
sanitize-disposition = 
tag-language = eng

[Permissions]
gid = -1
uid = -1
chmod = 0644

[HDR]
space = bt2020nc
transfer = smpte2084
primaries = bt2020
filter = 
force-filter = False
codec-parameters = 
pix-fmt = 
preset = 
codec = 

I have two files here:

1) Needs to be reencoded

General
Complete name                  : F:\xxxxx (2019)\xxxxx (2019) - BLURAY-2160p - x264 10 [EN] AC3 [EN].mp4
Format                         : MPEG-4
Format profile                 : Base Media
Codec ID                       : isom (isom/iso2/avc1/mp41)
File size                      : 10.8 GiB
Duration                       : 2 h 1 min
Overall bit rate mode          : Variable
Overall bit rate               : 12.7 Mb/s
Writing application            : Lavf58.9.100

Video
ID                             : 1
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : High 10@L5.1
Format settings                : CABAC / 4 Ref Frames
Format settings, CABAC         : Yes
Format settings, Reference fra : 4 frames
Codec ID                       : avc1
Codec ID/Info                  : Advanced Video Coding
Duration                       : 2 h 1 min
Bit rate                       : 12.1 Mb/s
Width                          : 3 840 pixels
Height                         : 2 160 pixels
Display aspect ratio           : 16:9
Frame rate mode                : Constant
Frame rate                     : 23.976 (24000/1001) FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 10 bits
Scan type                      : Progressive
Bits/(Pixel*Frame)             : 0.061
Stream size                    : 10.3 GiB (95%)
Writing library                : x264 core 155 r2901 7d0ff22
Encoding settings              : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=81 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box        : avcC

2) Should not be touched / plays fine as is

General
Unique ID                      : 175847093374737083405829903098415901942 (0x844AEB14294879A4EA487B0E43276CF6)
Complete name                  : F:\xxxxxx (1999)\xxxxxx (1999) - Bluray-2160p - x265 10 [EN] TrueHD Atmos [Chinese].mkv
Format                         : Matroska
Format version                 : Version 4
File size                      : 23.2 GiB
Duration                       : 2 h 16 min
Overall bit rate mode          : Variable
Overall bit rate               : 24.4 Mb/s
Encoded date                   : UTC 2018-07-07 06:10:51
Writing application            : mkvmerge v24.0.0 ('Beyond The Pale') 64-bit
Writing library                : libebml v1.3.6 + libmatroska v1.4.9

Video
ID                             : 1
Format                         : HEVC
Format/Info                    : High Efficiency Video Coding
Format profile                 : Main 10@L5@Main
HDR format                     : SMPTE ST 2086, HDR10 compatible
Codec ID                       : V_MPEGH/ISO/HEVC
Duration                       : 2 h 16 min
Bit rate                       : 19.8 Mb/s
Width                          : 3 840 pixels
Height                         : 1 600 pixels
Display aspect ratio           : 2.40:1
Frame rate mode                : Constant
Frame rate                     : 23.976 (23976/1000) FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 10 bits
Bits/(Pixel*Frame)             : 0.135
Stream size                    : 18.9 GiB (81%)
Writing library                : x265 2.8+15-d693a5aa5541:[Windows][MSVC 1914][64 bit] 10bit
Encoding settings              : cpuid=1111039 / frame-threads=5 / numa-pools=36 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=3840x1600 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=6 / no-allow-non-conformance / repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=8 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=24 / lookahead-slices=8 / scenecut=40 / radl=0 / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=2 / limit-refs=3 / no-limit-modes / me=2 / subme=6 / merange=64 / temporal-mvp / weightp / weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=4 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=18.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=9 / transfer=16 / colormatrix=9 / chromaloc=0 / display-window=0 / master-display=G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,20) / max-cll=992,518 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / aq-motion / hdr / hdr-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei
Default                        : Yes
Forced                         : No
Color range                    : Limited
Color primaries                : BT.2020
Transfer characteristics       : PQ
Matrix coefficients            : BT.2020 non-constant
Mastering display color primar : BT.2020
Mastering display luminance    : min: 0.0020 cd/m2, max: 1000 cd/m2
Maximum Content Light Level    : 992 cd/m2
Maximum Frame-Average Light Le : 518 cd/m2
mdhiggins commented 3 years ago

You should be able to do this using a combination of pixfmt and maybe leveraging the HDR section settings though you’ll need to figure out which ones you want to include and which ones you don’t (I don’t know offhand). Just include the pixfmts used for x264 8bit and hevc8bit/10bit and leave the x264 10bit off the list

mdhiggins commented 3 years ago

If that doesn't work feel free to reopen

eikowagenknecht commented 3 years ago

Thank you very much for taking the time to reply :-) I'm currently having build issues with my docker container so I can't test, but I'm not sure yet how to differentiate this by the pixfmts anyways.

File 1: Video: MPEG4 Video (H264) 3840x2160 23.976fps 12082kbps [V: h264 high 10 L5.1, yuv420p10le, 3840x2160, 12082 kb/s] doesn't File 2: Video: HVC1 3840x1600 23.976fps [V: hevc main 10 L5.0, yuv420p10le, 3840x1600 [default]] works

Both are identified as yuv420p10le so I can either allow or disallow both by using pixfmts. Probably I'm missing something here.

mdhiggins commented 3 years ago

Nah it looks like they are the same. That's unfortunate. There's not currently a work flow to have entirely separate profiles for different codecs If you post the FFProbe info for sample files (ffprobe -show_streams) I can see if there's some other characteristic that would be helpful

eikowagenknecht commented 3 years ago

Sure. The command didn't work so with a little bit of googling I changed it to ffprobe -show_streams -select_streams v input.xxx. I hope this is what you meant.

File 1:

ffprobe version 2020-12-27-git-bff6fbead8-full_build-www.gyan.dev Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 62.100 / 56. 62.100
  libavcodec     58.115.102 / 58.115.102
  libavformat    58. 65.100 / 58. 65.100
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 94.100 /  7. 94.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\xxxxx x264 10 [EN] AC3 [EN].mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.9.100
  Duration: 02:01:47.46, start: 0.000000, bitrate: 12728 kb/s
    Stream #0:0(und): Video: h264 (High 10) (avc1 / 0x31637661), yuv420p10le, 3840x2160 [SAR 1:1 DAR 16:9], 12082 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
    Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
    Side data:
      audio service type: main
    Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High 10
codec_type=video
codec_time_base=1001/48000
codec_tag_string=avc1
codec_tag=0x31637661
width=3840
height=2160
coded_width=3840
coded_height=2160
closed_captions=0
has_b_frames=2
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p10le
level=51
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1/24000
start_pts=0
start_time=0.000000
duration_ts=175378203
duration=7307.425125
bit_rate=12082335
max_bit_rate=N/A
bits_per_raw_sample=10
nb_frames=175203
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=VideoHandler
TAG:vendor_id=[0][0][0][0]
[/STREAM]

File 2:

ffprobe version 2020-12-27-git-bff6fbead8-full_build-www.gyan.dev Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 62.100 / 56. 62.100
  libavcodec     58.115.102 / 58.115.102
  libavformat    58. 65.100 / 58. 65.100
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 94.100 /  7. 94.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, matroska,webm, from 'F:\xxxxx x265 10 [EN] TrueHD Atmos [Chinese].mkv':
  Metadata:
    encoder         : libebml v1.3.6 + libmatroska v1.4.9
    creation_time   : 2018-07-07T06:10:51.000000Z
  Duration: 02:16:18.68, start: 0.000000, bitrate: 24374 kb/s
    Chapter #0:0: start 0.000000, end 205.788000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 205.788000, end 395.645000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 395.645000, end 582.665000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 582.665000, end 718.300000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 718.300000, end 1007.423000
    Metadata:
      title           : Chapter 5
    Chapter #0:5: start 1007.423000, end 1293.542000
    Metadata:
      title           : Chapter 6
    Chapter #0:6: start 1293.542000, end 1508.590000
    Metadata:
      title           : Chapter 7
    Chapter #0:7: start 1508.590000, end 1731.146000
    Metadata:
      title           : Chapter 8
    Chapter #0:8: start 1731.146000, end 1945.193000
    Metadata:
      title           : Chapter 9
    Chapter #0:9: start 1945.193000, end 2121.869000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 2121.869000, end 2320.901000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 2320.901000, end 2662.576000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 2662.576000, end 2793.540000
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 2793.540000, end 2937.851000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 2937.851000, end 3211.291000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 3211.291000, end 3392.138000
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 3392.138000, end 3541.287000
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 3541.287000, end 3668.581000
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 3668.581000, end 3916.495000
    Metadata:
      title           : Chapter 19
    Chapter #0:19: start 3916.495000, end 4066.812000
    Metadata:
      title           : Chapter 20
    Chapter #0:20: start 4066.812000, end 4353.432000
    Metadata:
      title           : Chapter 21
    Chapter #0:21: start 4353.432000, end 4669.581000
    Metadata:
      title           : Chapter 22
    Chapter #0:22: start 4669.581000, end 4863.108000
    Metadata:
      title           : Chapter 23
    Chapter #0:23: start 4863.108000, end 5105.350000
    Metadata:
      title           : Chapter 24
    Chapter #0:24: start 5105.350000, end 5385.129000
    Metadata:
      title           : Chapter 25
    Chapter #0:25: start 5385.129000, end 5487.565000
    Metadata:
      title           : Chapter 26
    Chapter #0:26: start 5487.565000, end 5845.256000
    Metadata:
      title           : Chapter 27
    Chapter #0:27: start 5845.256000, end 6064.975000
    Metadata:
      title           : Chapter 28
    Chapter #0:28: start 6064.975000, end 6260.337000
    Metadata:
      title           : Chapter 29
    Chapter #0:29: start 6260.337000, end 6420.497000
    Metadata:
      title           : Chapter 30
    Chapter #0:30: start 6420.497000, end 6618.528000
    Metadata:
      title           : Chapter 31
    Chapter #0:31: start 6618.528000, end 6776.686000
    Metadata:
      title           : Chapter 32
    Chapter #0:32: start 6776.686000, end 6996.906000
    Metadata:
      title           : Chapter 33
    Chapter #0:33: start 6996.906000, end 7129.372000
    Metadata:
      title           : Chapter 34
    Chapter #0:34: start 7129.372000, end 7347.423000
    Metadata:
      title           : Chapter 35
    Chapter #0:35: start 7347.423000, end 7541.784000
    Metadata:
      title           : Chapter 36
    Chapter #0:36: start 7541.784000, end 7726.802000
    Metadata:
      title           : Chapter 37
    Chapter #0:37: start 7726.802000, end 8178.420000
    Metadata:
      title           : Chapter 38
    Chapter #0:38: start 8178.420000, end 8178.679000
    Metadata:
      title           : Chapter 39
    Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x1600, SAR 1:1 DAR 12:5, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Metadata:
      BPS-eng         : 19817752
      DURATION-eng    : 02:16:18.679000000
      NUMBER_OF_FRAMES-eng: 196092
      NUMBER_OF_BYTES-eng: 20260380018
      _STATISTICS_WRITING_APP-eng: mkvmerge v24.0.0 ('Beyond The Pale') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-07-07 06:10:51
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: truehd, 48000 Hz, 7.1, s32 (24 bit) (default)
    Metadata:
      BPS-eng         : 4419606
      DURATION-eng    : 02:16:18.670000000
      NUMBER_OF_FRAMES-eng: 9814404
      NUMBER_OF_BYTES-eng: 4518312410
      _STATISTICS_WRITING_APP-eng: mkvmerge v24.0.0 ('Beyond The Pale') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-07-07 06:10:51
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(chi): Subtitle: hdmv_pgs_subtitle, 1920x1080 (default)
    Metadata:
      title           : CHS/ENG
      BPS-eng         : 39581
      DURATION-eng    : 02:11:13.991000000
      NUMBER_OF_FRAMES-eng: 3220
      NUMBER_OF_BYTES-eng: 38957841
      _STATISTICS_WRITING_APP-eng: mkvmerge v24.0.0 ('Beyond The Pale') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-07-07 06:10:51
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3(chi): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Metadata:
      title           : CHS
      BPS-eng         : 25570
      DURATION-eng    : 02:11:13.991000000
      NUMBER_OF_FRAMES-eng: 3220
      NUMBER_OF_BYTES-eng: 25167516
      _STATISTICS_WRITING_APP-eng: mkvmerge v24.0.0 ('Beyond The Pale') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-07-07 06:10:51
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:4(chi): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Metadata:
      title           : CHT
      BPS-eng         : 26010
      DURATION-eng    : 02:11:13.991000000
      NUMBER_OF_FRAMES-eng: 3220
      NUMBER_OF_BYTES-eng: 25600694
      _STATISTICS_WRITING_APP-eng: mkvmerge v24.0.0 ('Beyond The Pale') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-07-07 06:10:51
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:5(chi): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Metadata:
      title           : CHT/ENG
      BPS-eng         : 40022
      DURATION-eng    : 02:11:13.991000000
      NUMBER_OF_FRAMES-eng: 3220
      NUMBER_OF_BYTES-eng: 39391789
      _STATISTICS_WRITING_APP-eng: mkvmerge v24.0.0 ('Beyond The Pale') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-07-07 06:10:51
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[STREAM]
index=0
codec_name=hevc
codec_long_name=H.265 / HEVC (High Efficiency Video Coding)
profile=Main 10
codec_type=video
codec_time_base=125/2997
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=3840
height=1600
coded_width=3840
coded_height=1600
closed_captions=0
has_b_frames=2
sample_aspect_ratio=1:1
display_aspect_ratio=12:5
pix_fmt=yuv420p10le
level=150
color_range=tv
color_space=bt2020nc
color_transfer=smpte2084
color_primaries=bt2020
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:BPS-eng=19817752
TAG:DURATION-eng=02:16:18.679000000
TAG:NUMBER_OF_FRAMES-eng=196092
TAG:NUMBER_OF_BYTES-eng=20260380018
TAG:_STATISTICS_WRITING_APP-eng=mkvmerge v24.0.0 ('Beyond The Pale') 64-bit
TAG:_STATISTICS_WRITING_DATE_UTC-eng=2018-07-07 06:10:51
TAG:_STATISTICS_TAGS-eng=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[/STREAM]

Thanks again for tatking the time to look into this!

mdhiggins commented 3 years ago

Hm so unfortunately I'm not seeing any easy solution here. Doesn't look like there's a specific parameter that you can use to filter these out and there isn't currently an option for per-codec subcharacterisitc filtering

I just updated the custom.py functionality a little bit to help in this case

f97c6a6ba78c5808787b9718e7b99111b6b9ef03

You can now define custom parameters that will prevent a stream from copying and there's a sample custom.py file in setup folder

For your specific function, I would think this custom function should do it:

def blockVideoCopy(mp, stream, path):
    # Custom function that performs additional check to see if video should not copy
    mp.log.info("Initiating custom video copy check method.")
    if stream.codec == 'h264' and stream.pix_fmt == 'yuv420p10le':
        return True
    return False
mdhiggins commented 3 years ago

https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/Custom-Functions

eikowagenknecht commented 3 years ago

Wow, amazing work. Sounds like it will do just what I want 👍 My ffmpeg build chain is still broken (jrottenberg/ffmpeg broke for vaapi, but at least it's fixed upstream now, just waiting for duckerhub to catch up) so I can't try this out today but will comment as soon as it's working again. Thank you!

eikowagenknecht commented 3 years ago

Finally got the upstream error fixed so my images run again!

And it works just like you said it would (not a surprise there ;-)). File 1 is logging "Custom video stream copy check is preventing copying the stream." and being converted while file 2 is just copied.

Perfect!