polewcaribbean.blogg.se

Real time video player
Real time video player











Create video encoding task and set main parameters for the video encodeįfMpegTask = ffmpegConverter.ConvertLiveMedia(ĬustomInputArgs = " -pix_fmt bgr24 -video_size " + frameWidth + "x" + frameHeight + " -framerate " + FrameRate + " ", // windows bitmap pixel formatĬustomOutputArgs = " -threads 7 -preset ultrafast -profile:v baseline -level 3.0 -tune zerolatency -qp 0 -pix_fmt yuv420p -g " + g + " -keyint_min " + g + " -flags -global_header -sc_threshold 40 -qscale:v 1 -crf 25 -b:v 10000k -bufsize 20000k -s " + outPutFrameSize + " -r " + FrameRate + " -pass 1 -coder 1 -movflags frag_keyframe -movflags +faststart -c:a libfdk_aac -b:a 128k " frame.ToBitmap().Save(msBit, frame.ToBitmap().RawFormat)

real time video player real time video player

String outPutFrameSize = frameWidth.ToString() + "x" + frameHeight.ToString() these are the parameters i use for h264 encoding TwoSecondVideoBitmapFramesForEncode.Clear() Thread = new Thread(new ThreadStart(encodeTwoSecondVideo)) ĬopyOfTwoSecondVideo = twoSecondVideoBitmapFramesForEncode.ToList() If (twoSecondVideoBitmapFramesForEncode.Count = (int)FrameRate) TwoSecondVideoBitmapFramesForEncode.Add(frameBmp) Private void ProcessFrame(object sender, EventArgs arg)įrameBmp = new Bitmap((int)frameWidth, (int)frameHeight, PixelFormat.Format24bppRgb) Here I capture the frames and store them in a list When I received stream via VLC player there is some millisecond of delay between packets and also I noticed there a frame lost. But I cannot achieve the smooth streaming. Then I'm sending that data using UDP protocol through LAN. After stopping that task I can get encoded data as byte array. I write that video frames to ffmpegĪnd start the ffmpeg to encode.

real time video player

After filling this list I start another thread to encode that 1 second chunkįor encoding purpose I use ffmpeg wrapper called nreco. if frame rate isģ0 it will store 30 video frames. To achieve this I create the bitmap list and I save captured bitmap to this list using one thread.Īnd also I display those frames in a picture box. To stream local video file in real time I use emgu cv to capture the video frame as bitmaps. I use a capture card to capture some live source and need to stream in real time.Īnd also need to stream a local video file. I'm developing an application for real time streaming.













Real time video player