sipsorcery-org / SIPSorceryMedia.FFmpeg

GNU Lesser General Public License v2.1
31 stars 24 forks source link

Unable to decode APP fields: Invalid data found when processing input Input #0, dshow, from 'video=HD Webcam': #30

Closed mail2mhossain closed 2 years ago

mail2mhossain commented 2 years ago

dshow passing through packet of type video size 246597 timestamp 711091400000 orig timestamp 711091375007 graph timestamp 711091400000 diff 24993 HD Webcam [mjpeg @ 0000015e257e4380] unable to decode APP fields: Invalid data found when processing input Input #0, dshow, from 'video=HD Webcam': Duration: N/A, start: 71109.140000, bitrate: N/A Stream #0:0: Video: mjpeg (Baseline), 1 reference frame (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown, center), 1280x720, 30 fps, 30 tbr, 10000k tbn, 10000k tbc dshow passing through packet of type video size 246506 timestamp 711091710000 orig timestamp 711091695233 graph timestamp 711091710000 diff 14767 HD Webcam dshow passing through packet of type video size 243761 timestamp 711092030000 orig timestamp 711092016403 graph timestamp 711092030000 diff 13597 HD Webcam

Code:

_videoSource = new FFmpegCameraSource(WebCamName); _videoSink = new FFmpegVideoEndPoint();

        VideoCodecsEnum VideoCodec = VideoCodecsEnum.VP8;
        _videoSink.RestrictFormats(format => format.Codec == VideoCodec);
        _videoSource.RestrictFormats(x => x.Codec == VideoCodec);

        MediaStreamTrack videoTrack = new MediaStreamTrack(_videoSource.GetVideoSourceFormats(), 
            MediaStreamStatusEnum.SendRecv);
        _peerConnection.addTrack(videoTrack);

        _videoSource.OnVideoSourceEncodedSample += _peerConnection.SendVideo;
        _peerConnection.OnVideoFrameReceived += _videoSink.GotVideoFrame;

        _peerConnection.OnVideoFormatsNegotiated += (formats) =>
        {
            _videoSource.SetVideoSourceFormat(formats.First());
            _videoSink.SetVideoSinkFormat(formats.First());
        };

        _videoSource.OnVideoSourceRawSampleFaster += _videoSource_OnVideoSourceRawSampleFaster;

        _videoSink.OnVideoSinkDecodedSampleFaster += (RawImage rawImage) =>
        {
            Bitmap bmpImage = new Bitmap(rawImage.Width, rawImage.Height, rawImage.Stride, PixelFormat.Format24bppRgb, rawImage.Sample);
        };

private async void _webRTC_OnPeerConnectionConnected(object sender, EventArgs e) { await _videoSource.StartVideo(); await _videoSink.StartVideoSink();

        await _audioSource.StartAudio();
        await _audioSink.StartAudioSink();
    }
ChristopheI commented 2 years ago

seems a duplicate of https://github.com/sipsorcery-org/SIPSorceryMedia.FFmpeg/issues/32