lib/parsers/moov_parser.rb
# The dimensions are located in tkhd atom, but in some files it is necessary
# to get it below the video track, because it can have other tracks such as
# audio which does not have the dimensions.
# More details in https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-DontLinkElementID_147
#
# Returns [width, height] if the dimension is found
# Returns [nil, nil] if the dimension is not found
The dimensions are located in tkhd atom, but in some files it is necessary
to get it below the video track, because it can have other tracks such as
audio which does not have the dimensions.

Returns [width, height] if the dimension is found
Returns [nil, nil] if the dimension is not found
The dimensions are located in tkhd atom but in some files it is necessary to get it below the video track because it can have other tracks such as audio which does not have the dimensions . Returns [ width height ] if the dimension is found Returns [ nil nil ] if the dimension is not found
def parse_dimensions(decoder, atom_tree)
    video_trak_atom = decoder.find_video_trak_atom(atom_tree)
    tkhd = begin
      if video_trak_atom
        decoder.find_first_atom_by_path([video_trak_atom], 'trak', 'tkhd')
      else
        decoder.find_first_atom_by_path(atom_tree, 'moov', 'trak', 'tkhd')
      end
    end
    if tkhd
      [tkhd.field_value(:track_width).first, tkhd.field_value(:track_height).first]
    else
      [nil, nil]
    end
  end
def parse_dimensions ( decoder , atom_tree ) video_trak_atom = decoder . find_video_trak_atom ( atom_tree ) tkhd = begin if video_trak_atom decoder . find_first_atom_by_path ( [ video_trak_atom ] , 'trak' , 'tkhd' ) else decoder . find_first_atom_by_path ( atom_tree , 'moov' , 'trak' , 'tkhd' ) end end if tkhd [ tkhd . field_value ( :track_width ) . first , tkhd . field_value ( :track_height ) . first ] else [ nil , nil ] end end
The dimensions are located in tkhd atom, but in some files it is necessary
to get it below the video track, because it can have other tracks such as
audio which does not have the dimensions.
The dimensions are located in tkhd atom but in some files it is necessary to get it below the video track because it can have other tracks such as audio which does not have the dimensions .
decoder
atom_tree