Closed eikowagenknecht closed 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
If that doesn't work feel free to reopen
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.
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
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!
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
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!
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!
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:
I have two files here:
1) Needs to be reencoded
2) Should not be touched / plays fine as is