other_video_transcoding 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88e79f218a2cdbb3a930db25fd5d5b94e6294fec90f451bb979457c68ae13a82
4
- data.tar.gz: cc6b33de67d3da5fb80d59634181ccdd89aa539cb4d35b5d5729bd3b4ee5dae0
3
+ metadata.gz: 325b662c56c03a0cac33994a3ab165381fe801615072c87188de4b8f6bd954f7
4
+ data.tar.gz: c26a3551deed5d3966168b881da8730672024b8363fc1e0e8611a27ca5ec9426
5
5
  SHA512:
6
- metadata.gz: 638f9905c7df90b4c7921ae6a1d4b54e93f264c119a2599356ce911132b9688eba83edfe5ab2a0d6037326ce0c62c7aa4813792da45e15840f06d38bff1f999c
7
- data.tar.gz: e213384ceb4e30a711e0a161ec371e72cb53b0d8d562ee7dc73dd8aade72dca2df1e8855800643dc36afe4cfa4356ae55a40fd80b2de503944261e7042388f73
6
+ metadata.gz: dafd0f33a13e2b0f90db7e8ab8d0d7db19577177128dd133538593f762daddbf06c1ebf2735f05828b96255fc7970ce091434b78d9d80780598e9f18555ec5b1
7
+ data.tar.gz: 8d294809aceafa52a1b73007593d9e36ca966e4aa15a43b4a4ca99c74f9df23bfb8c0c892b9ddba6d3fe009798f8de35480c942cbb26db2b3fd7c8b913022e6a
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  This single document contains all of the notes created for each [release](https://github.com/donmelton/other_video_transcoding/releases).
4
4
 
5
+ ## [0.10.0](https://github.com/donmelton/other_video_transcoding/releases/tag/0.10.0)
6
+
7
+ Thursday, January 27, 2022
8
+
9
+ * Add a `--nvenc-gpu-only` option to `other-transcode` to keep data on the GPU for greater speed, if possible. Deinterlacing is allowed but cropping, scaling, detelecining, setting frame rates and burning subtitles will prevent this from working and may actually slow things down. Performance can also be affected negatively depending on PC configuration. Please note that the `--nvenc-gpu-only` option requires `ffmpeg` version 5.0 or later.
10
+ * Add a `--x264-cbr` option to `other-transcode` to simplify access to constant bitrate (CBR) ratecontrol. Despite the name, actual output bitrates from the `x264` encoder are variable and below what might be expected. So, default video bitrate targets are raised to accommodate this.
11
+ * Enable proper crop detection in `other-transcode` for 4K UHD Blu-ray rips and other media with a 10-bit color depth. This was done by changing the `limit` value passed to the `cropdetect` filter from an integer constant to a floating point equation. Via [ #52](https://github.com/donmelton/other_video_transcoding/issues/52).
12
+ * Modify `other-transcode` to add a workaround for the mapping of BT.470 M and BT.470 BG color transfer characteristics from values returned from `ffprobe` to values actually used by `ffmpeg`. Via [ #112](https://github.com/donmelton/other_video_transcoding/issues/112).
13
+ * Modify `other-transcode` to allow parentheses within the argument to the `--yadif-params`, `--x264-params` and `--x265-params` options. Via [ #119](https://github.com/donmelton/other_video_transcoding/issues/119).
14
+ * Modify `ask-ffmpeg-log` to fix detection of frame counts less than five digits within `.log` files from very short duration videos. Via [ #126](https://github.com/donmelton/other_video_transcoding/issues/126).
15
+ * Modify `ask-ffmpeg-log` to fix detection of statistics within `.log` files not generated by `other-transcode`.
16
+ * Remove the deprecated `--nvenc-rc-mode` and `--aac-stereo` options from `other-transcode`.
17
+ * Update all copyright notices to the year 2022.
18
+
5
19
  ## [0.9.0](https://github.com/donmelton/other_video_transcoding/releases/tag/0.9.0)
6
20
 
7
21
  Saturday, June 5, 2021
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019-2021 Don Melton
1
+ Copyright (c) 2019-2022 Don Melton
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/bin/ask-ffmpeg-log CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ask-ffmpeg-log
4
4
  #
5
- # Copyright (c) 2019-2021 Don Melton
5
+ # Copyright (c) 2019-2022 Don Melton
6
6
  #
7
7
 
8
8
  require 'abbrev'
@@ -16,8 +16,8 @@ module Transcoding
16
16
  class Command
17
17
  def about
18
18
  <<-HERE
19
- ask-ffmpeg-log 0.9.0
20
- Copyright (c) 2019-2021 Don Melton
19
+ ask-ffmpeg-log 0.10.0
20
+ Copyright (c) 2019-2022 Don Melton
21
21
  HERE
22
22
  end
23
23
 
@@ -138,9 +138,9 @@ Options:
138
138
  fail "not a ffmpeg-generated `.log` file: #{log}"
139
139
  end
140
140
 
141
- stats = content.match(/^frame=.*[.0-9]+x */m).to_s.lines.last.to_s.rstrip
141
+ stats = content.match(/^frame=.* speed= *[.0-9]+x */m).to_s.lines.last.to_s.rstrip
142
142
 
143
- if stats =~ /frame=([0-9]+) fps=( *[.0-9]+)/
143
+ if stats =~ /frame=( *[0-9]+) fps=( *[.0-9]+)/
144
144
  frames = $1
145
145
  fps = $2
146
146
  seconds = frames.to_f / fps.lstrip.to_f
data/bin/other-transcode CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # other-transcode
4
4
  #
5
- # Copyright (c) 2019-2021 Don Melton
5
+ # Copyright (c) 2019-2022 Don Melton
6
6
  #
7
7
 
8
8
  require 'English'
@@ -18,8 +18,8 @@ module Transcoding
18
18
  class Command
19
19
  def about
20
20
  <<-HERE
21
- other-transcode 0.9.0
22
- Copyright (c) 2019-2021 Don Melton
21
+ other-transcode 0.10.0
22
+ Copyright (c) 2019-2022 Don Melton
23
23
  HERE
24
24
  end
25
25
 
@@ -170,6 +170,8 @@ Nvidia video encoder options:
170
170
  set mode for using B-frames as reference frames
171
171
  --nvenc-cq QUALITY
172
172
  use constant quality (CQ) ratecontrol at target quality
173
+ --nvenc-gpu-only
174
+ keep data on GPU for greater speed, if possible
173
175
 
174
176
  Intel Quick Sync video encoder options:
175
177
  --qsv-refs FRAMES
@@ -193,6 +195,9 @@ Video Acceleration API encoder options:
193
195
  set numeric level of compression
194
196
 
195
197
  x264 software video encoder options:
198
+ --x264-cbr use constant bitrate (CBR) ratecontrol
199
+ with variable bitrate output
200
+ (raises default video bitrate targets)
196
201
  --x264-avbr use average variable bitrate (AVBR) ratecontrol
197
202
  --x264-mbtree use macroblock-tree ratecontrol (disables AVBR if in use)
198
203
  --x264-quick increase encoding speed by 70-80%
@@ -358,6 +363,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
358
363
  @nvenc_bframes = nil
359
364
  @nvenc_bframe_refs = nil
360
365
  @nvenc_cq = nil
366
+ @nvenc_gpu_only = false
361
367
  @qsv_refs = nil
362
368
  @qsv_bframes = nil
363
369
  @amf_quality = nil
@@ -652,7 +658,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
652
658
 
653
659
  opts.on '--yadif-params ARG' do |arg|
654
660
  arg.split ':' do |param|
655
- fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,]+$/
661
+ fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,\(\)]+$/
656
662
  end
657
663
 
658
664
  @yadif_params = arg
@@ -750,12 +756,11 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
750
756
  @nvenc_cq = [[arg, 1].max, 51].min.to_s.sub(/\.0$/, '')
751
757
  end
752
758
 
753
- opts.on '--nvenc-rc-mode ARG' do |arg|
754
- Kernel.warn '**********'
755
- Kernel.warn 'Using deprecated option: --nvenc-rc-mode'
756
- Kernel.warn '**********'
759
+ opts.on '--nvenc-gpu-only' do
757
760
  @encoder = @hevc ? 'hevc_nvenc' : 'h264_nvenc'
758
- fail UsageError, "invalid rate control argument: #{arg}" unless arg =~ /^vbr(_hq)?$/
761
+ @decode_scope = :all
762
+ @decode_method = 'cuda'
763
+ @nvenc_gpu_only = true
759
764
  end
760
765
 
761
766
  opts.on '--qsv-refs ARG', Integer do |arg|
@@ -804,6 +809,16 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
804
809
  @vaapi_compression = [arg, 0].max
805
810
  end
806
811
 
812
+ opts.on '--x264-cbr' do
813
+ @encoder = 'libx264'
814
+ @hevc = false
815
+ @x264_mbtree = true
816
+ @x264_avbr = false
817
+ @x264_params = nil
818
+ @maxrate = 1.0
819
+ @bufsize = nil
820
+ end
821
+
807
822
  opts.on '--x264-avbr' do
808
823
  @encoder = 'libx264'
809
824
  @hevc = false
@@ -830,7 +845,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
830
845
 
831
846
  opts.on '--x264-params ARG' do |arg|
832
847
  arg.split ':' do |param|
833
- fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,]+$/
848
+ fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,\(\)]+$/
834
849
  end
835
850
 
836
851
  @encoder = 'libx264'
@@ -843,7 +858,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
843
858
 
844
859
  opts.on '--x265-params ARG' do |arg|
845
860
  arg.split ':' do |param|
846
- fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,]+$/
861
+ fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,\(\)]+$/
847
862
  end
848
863
 
849
864
  @encoder = 'libx265'
@@ -911,13 +926,6 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
911
926
  @stereo_encoder = nil
912
927
  end
913
928
 
914
- opts.on '--aac-stereo' do
915
- Kernel.warn '**********'
916
- Kernel.warn 'Using deprecated option: --aac-stereo'
917
- Kernel.warn '**********'
918
- @stereo_encoder = nil
919
- end
920
-
921
929
  opts.on '--aac-only' do
922
930
  @surround_encoder = nil
923
931
  @stereo_encoder = nil
@@ -1028,10 +1036,19 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
1028
1036
 
1029
1037
  @nvenc_cq = nil unless @encoder =~ /nvenc$/
1030
1038
  @ten_bit = (@hevc and @encoder =~ /(nvenc|qsv|x265)$/ ? true : false) if @ten_bit.nil?
1031
- @target_2160p ||= @hevc ? 8000 : 12000
1032
- @target_1080p ||= @hevc ? 4000 : 6000
1033
- @target_720p ||= @hevc ? 2000 : 3000
1034
- @target_480p ||= @hevc ? 1000 : 1500
1039
+
1040
+ if @encoder == 'libx264' and @x264_mbtree and @maxrate == 1.0
1041
+ @target_2160p ||= 15000
1042
+ @target_1080p ||= 7500
1043
+ @target_720p ||= 4500
1044
+ @target_480p ||= 2250
1045
+ else
1046
+ @target_2160p ||= @hevc ? 8000 : 12000
1047
+ @target_1080p ||= @hevc ? 4000 : 6000
1048
+ @target_720p ||= @hevc ? 2000 : 3000
1049
+ @target_480p ||= @hevc ? 1000 : 1500
1050
+ end
1051
+
1035
1052
  @decode_method ||= @encoder =~ /nvenc$/ ? 'cuda' : 'auto'
1036
1053
 
1037
1054
  if @stereo_encoder.nil?
@@ -1435,7 +1452,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
1435
1452
  '-ss', position.to_s,
1436
1453
  '-i', path,
1437
1454
  '-frames:v', '15',
1438
- '-filter:v', 'cropdetect=24:2',
1455
+ '-filter:v', 'cropdetect=24.0/255:2',
1439
1456
  '-an',
1440
1457
  '-sn',
1441
1458
  '-ignore_unknown',
@@ -1664,6 +1681,8 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
1664
1681
  decode_options = []
1665
1682
  end
1666
1683
 
1684
+ nvenc_gpu_only = false
1685
+
1667
1686
  if (@decode_scope == :vc1 and video['codec_name'] == 'vc1') or @decode_scope == :all
1668
1687
  if @encoder =~ /vaapi$/
1669
1688
  decode_options = [
@@ -1680,6 +1699,18 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
1680
1699
 
1681
1700
  decode_options += ['-hwaccel', decode_method]
1682
1701
 
1702
+ if @nvenc_gpu_only and
1703
+ decode_method == 'cuda' and
1704
+ @encoder =~ /nvenc$/ and
1705
+ overlay_filter.nil? and
1706
+ (frame_rate_filter.nil? or frame_rate_filter !~ /fps=/) and
1707
+ crop_filter.nil? and
1708
+ scale_filter.nil?
1709
+ decode_options += ['-hwaccel_output_format', 'cuda']
1710
+ nvenc_gpu_only = true
1711
+ frame_rate_filter.sub!(/^yadif/, 'yadif_cuda') unless frame_rate_filter.nil?
1712
+ end
1713
+
1683
1714
  if decode_method == 'qsv' and
1684
1715
  overlay_filter.nil? and
1685
1716
  frame_rate_filter.nil? and
@@ -1712,8 +1743,14 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
1712
1743
  end
1713
1744
  end
1714
1745
 
1746
+ ten_bit = (@ten_bit ? (@eight_bit_vc1 ? (video['codec_name'] != 'vc1') : true) : false)
1747
+ pix_fmt = true
1748
+
1715
1749
  if @encoder =~ /vaapi$/ and not decode_options.include?('-hwaccel')
1716
1750
  conversion_filter = 'format=nv12,hwupload'
1751
+ elsif nvenc_gpu_only
1752
+ conversion_filter = "scale_cuda=format=#{ten_bit ? 'p010le' : 'yuv420p'}"
1753
+ pix_fmt = false
1717
1754
  else
1718
1755
  conversion_filter = nil
1719
1756
  end
@@ -1754,8 +1791,9 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
1754
1791
 
1755
1792
  color_primaries = video['color_primaries']
1756
1793
  color_trc = video['color_transfer']
1794
+ color_trc = 'gamma22' if color_trc == 'bt470m'
1795
+ color_trc = 'gamma28' if color_trc == 'bt470bg'
1757
1796
  colorspace = video['color_space']
1758
- ten_bit = (@ten_bit ? (@eight_bit_vc1 ? (video['codec_name'] != 'vc1') : true) : false)
1759
1797
 
1760
1798
  if (video.fetch('pix_fmt', 'yuv420p') == 'yuv420p10le') and ten_bit
1761
1799
  color_primaries ||= 'bt2020'
@@ -1845,7 +1883,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
1845
1883
 
1846
1884
  Kernel.warn text
1847
1885
  encode_options += ['-c:v', @encoder]
1848
- encode_options += ['-pix_fmt:v', (@encoder =~ /(videotoolbox|nvenc|qsv)$/ ? 'p010le' : 'yuv420p10le')] if ten_bit
1886
+ encode_options += ['-pix_fmt:v', (@encoder =~ /(videotoolbox|nvenc|qsv)$/ ? 'p010le' : 'yuv420p10le')] if ten_bit and pix_fmt
1849
1887
  encode_options += (@nvenc_cq.nil? ? ['-b:v', "#{bitrate}k"] : ['-cq:v', @nvenc_cq]) unless @encoder == 'copy'
1850
1888
  encode_options += ['-maxrate:v', "#{maxrate}k"] if maxrate > 0
1851
1889
  encode_options += ['-bufsize:v', "#{bufsize}k"] if bufsize > 0
Binary file
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'other_video_transcoding'
3
- s.version = '0.9.0'
3
+ s.version = '0.10.0'
4
4
  s.required_ruby_version = '>= 2.0'
5
5
  s.summary = 'Other tools to transcode videos.'
6
6
  s.description = <<-HERE
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: other_video_transcoding
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Melton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-05 00:00:00.000000000 Z
11
+ date: 2022-01-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " Other Video Transcoding is a package of tools to transcode videos.\n"
14
14
  email: don@blivet.com
@@ -36,6 +36,7 @@ files:
36
36
  - other_video_transcoding-0.6.0.gem
37
37
  - other_video_transcoding-0.7.0.gem
38
38
  - other_video_transcoding-0.8.0.gem
39
+ - other_video_transcoding-0.9.0.gem
39
40
  - other_video_transcoding.gemspec
40
41
  homepage: https://github.com/donmelton/other_video_transcoding
41
42
  licenses:
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  - !ruby/object:Gem::Version
57
58
  version: '0'
58
59
  requirements: []
59
- rubygems_version: 3.1.4
60
+ rubygems_version: 3.1.6
60
61
  signing_key:
61
62
  specification_version: 4
62
63
  summary: Other tools to transcode videos.