agsh / rtsp-ffmpeg

Node.js FFMpeg wrapper for streaming RTSP into MotionJPEG
MIT License
249 stars 84 forks source link

High resolution video playback #15

Open chinkan opened 6 years ago

chinkan commented 6 years ago

When I try to playback 4k video from my cam using the example code, it show only part of the video in the screen. 2017-07-14_172021 How can I fix it? Thanks!

P.S.: I had tried 1080p also same issue. I had changed to 704*576 and work perfectly. However I need to playback at lease 1080p for my project.

Seikon commented 6 years ago

Hi @chinkan

What browser are you using? What example are you using? (canvas or img html tag) Could you see errors in the javascript console?

chinkan commented 6 years ago

Hi @Seikon

I am use the latest Chrome version 59 and I tried the canvas version. I have changed the canvas size to <canvas width='2560' height='1440'> but nothing helps. Here is the console from google chrome. 2017-07-14_174511

Seikon commented 6 years ago

it is a bit strange. Has all the frame the same size or it changes in time? Try to force the change of the frame crossing in front of the camera and see if the size's image oscilate.

I never try this with 4K cameras, so it's very difficult to test it. Maybe the canvas hasn't enough memory to put the entire image. You can test it adding debug points and watching what appends when canvas draw the image.

chinkan commented 6 years ago

Hi @Seikon

I have another problem for the library, I added the option resolution : "640x480" but the video size still the original size.

Seikon commented 6 years ago

This is because in the example you are setting the resolution by code using ctx.drawImage(img,100,100); change the "100" value for your preference:

https://www.w3schools.com/tags/canvas_drawimage.asp