Sha256: 8fdcca7892a75abf12f7932e3004428cf3594f9783b0e7d530873eb20b163209

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

# frozen_string_literal: true

module MkvToolNix
  module Modules
    # https://mkvtoolnix.download/doc/mkvmerge.html
    class MkvMerge
      include MkvModule

      def initialize(bin_path)
        @bin_path = "#{bin_path}mkvmerge"
      end

      def version
        cmd = [@bin_path, '-V']

        result = call_cmd(cmd)

        result.stdout.strip
      end

      def info(file)
        cmd = [@bin_path, '-J']
        # cmd = [@bin_path, '--identififcation-format', 'json', '--identify']
        cmd << file

        result = call_cmd(cmd)

        json = JSON.parse(result.stdout)
        Types::Info::MkvContainer.create(json)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mkvtoolnix-0.7.0 lib/mkvtoolnix/modules/mkvmerge.rb