secile / OpenH264Lib.NET

Cisco's openh264 wrapper library for .NET Framework.
MIT License
110 stars 34 forks source link

Unable to play H264 Stream from Ambarella Camera #14

Open kinnersley opened 3 years ago

kinnersley commented 3 years ago

I have a number of H.264 cameras that output raw h264 data frames. I have made a player based on the OpenH264.NET example, decoding one frame at a time and displaying. This works for all but one of the cameras. There doesn’t seem to be anything unusual about the camera and VLC is able to play it fine from a file or UDP stream. I also built OpenH264 from source on Linux and ran the h264dec utility against the data and it seemed to have no issue decoding. Any ideas as to why there might be an issue with this one camera with OpenH264.NET?

    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "Main",
            "codec_type": "video",
            "codec_time_base": "1001/60000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 432,
            "height": 240,
            "coded_width": 432,
            "coded_height": 240,
            "closed_captions": 0,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "9:5",
            "pix_fmt": "yuvj420p",
            "level": 21,
            "color_range": "pc",
            "chroma_location": "left",
            "field_order": "progressive",
            "refs": 1,
            "is_avc": "false",
            "nal_length_size": "0",
            "r_frame_rate": "30000/1001",
            "avg_frame_rate": "30000/1001",
            "time_base": "1/1200000",
            "bits_per_raw_sample": "8",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            }
        }
    ]

UPDATE: I can see that DecodeFrame2 is returning dsNoParamSets (16) UPDATE2: It actually seems to alternate between frames, first dsNoParamSets (16) and then dsBitstreamError (4) the next frame...and so on

secile commented 3 years ago

Hello. Thank you for your question. But I can not awnser your question. I am very sorry. I remain this issure open until anyone awnser your question.