FFPROBE SWAPS WIDTH AND HEIGHT

Viewed 18

I just noticed that ffprobe swaps the width and height of some videos when fetching the data of those videos. Please help suggest how to go about this and get it right or any other package that is confirmed to work. Below is the resulting output after i used ffprobe to request for video metadata. I just requested the width and height, while some are correct, others are not as it swaps the value for width and height.

        {
        streams: [
        {
        index: 0,
        codec_name: 'aac',
        codec_long_name: 'AAC (Advanced Audio Coding)',
        profile: 'LC',
        codec_type: 'audio',
        codec_tag_string: 'mp4a',
        codec_tag: '0x6134706d',
        sample_fmt: 'fltp',
        sample_rate: 32000,
        channels: 1,
        channel_layout: 'mono',
        bits_per_sample: 0,
        id: '0x1',
        r_frame_rate: '0/0',
        avg_frame_rate: '0/0',
        time_base: '1/32000',
        start_pts: 0,
        start_time: 0,
        duration_ts: 12228608,
        duration: 382.144,
        bit_rate: 126250,
        max_bit_rate: 'N/A',
        bits_per_raw_sample: 'N/A',
        nb_frames: 11942,
        nb_read_frames: 'N/A',
        nb_read_packets: 'N/A',
        extradata_size: 2,
        tags: [Object],
        disposition: [Object]
        },
        {
        index: 1,
        codec_name: 'h264',
        codec_long_name: 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
        profile: 'High',
        codec_type: 'video',
        codec_tag_string: 'avc1',
        codec_tag: '0x31637661',
        width: 1920,
        height: 1080,
        coded_width: 1920,
        coded_height: 1080,
        closed_captions: 0,
        film_grain: 0,
        has_b_frames: 0,
        sample_aspect_ratio: 'N/A',
        display_aspect_ratio: 'N/A',
        pix_fmt: 'yuv420p',
        level: 50,
        color_range: 'unknown',
        color_space: 'unknown',
        color_transfer: 'unknown',
        color_primaries: 'unknown',
        chroma_location: 'unspecified',
        field_order: 'progressive',
        refs: 1,
        is_avc: 'true',
        nal_length_size: 4,
        id: '0x2',
        r_frame_rate: '25/1',
        avg_frame_rate: '25/1',
        time_base: '1/30000',
        start_pts: 0,
        start_time: 0,
        duration_ts: 11463600,
        duration: 382.12,
        bit_rate: 183454,
        max_bit_rate: 'N/A',
        bits_per_raw_sample: 8,
        nb_frames: 9553,
        nb_read_frames: 'N/A',
        nb_read_packets: 'N/A',
        extradata_size: 29,
        tags: [Object],
        disposition: [Object]
        }
        ],
        format: {
        filename: './input4.mp4',
        nb_streams: 2,
        nb_programs: 0,
        format_name: 'mov,mp4,m4a,3gp,3g2,mj2',
        format_long_name: 'QuickTime / MOV',
        start_time: 0,
        duration: 382.144,
        size: 14896948,
        bit_rate: 311860,
        probe_score: 100,
        tags: {
        major_brand: 'mp42',
        minor_version: '0',
        compatible_brands: 'isommp42',
        creation_time: '2022-09-23T20:39:00.000000Z'
        }
        },
        chapters: []
        }
0 Answers
Related