muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
https://www.webrtc-experiment.com/RecordRTC/
MIT License
6.54k stars 1.75k forks source link

whey size of recorded video is always 360x240? #746

Closed kouohhashi closed 3 years ago

kouohhashi commented 3 years ago

Hi,

I'm trying to record video and recording itself works great. but some how size is always 360x240.

here's my code .

let streams = await navigator.mediaDevices.getUserMedia({
  audio: true,
  video: { width: 720, height: 1280 },
})

recorder = new RecordRTCPromisesHandler(streams, {
    type: 'video',
    mimeType: 'video/webm',
    sampleRate: 16000,
    desiredSampRate: 16000,
    frameRate: 24,
});

I tried to modify canvas too but not worked.

And if i record video from mobile, video was heavily distorted because it make video 360x240...

How can I change size or aspect ratio correctly?

Thanks in advance.

kouohhashi commented 3 years ago

Looks official demo doesn't have such issue. Where is the code of official demo?

kouohhashi commented 3 years ago

I got the source of official demo. It seems I followed the options and only difference is demo use RecordRTC and I use RecordRTCPromisesHandler. But not working so far...

kouohhashi commented 3 years ago

It turns out using array for stream caused the problem.

below, size is fixed to 320x480.

recorder = new RecordRTC([audio_stream, video_stream], options)

below, size is okay,

recorder = new RecordRTC(video_stream, options)

Thanks,