openwebrtc icon indicating copy to clipboard operation
openwebrtc copied to clipboard

How can we set the video resolution/quality on Android?

Open carterbryden opened this issue 9 years ago • 12 comments

On iOS we can set resolution, bitrate, and framerate in videoattributes.m, but there's not an obvious way to set those in Android. Are we missing something here?

carterbryden avatar Nov 29 '15 23:11 carterbryden

Hi,

I have changed android-sdk (Utils.java) to achieve that (at least for resolution and bitrate).

Best Regards

Marcin Sielski

marcin-sielski avatar Nov 30 '15 20:11 marcin-sielski

@marcin-sielski would you mind sharing the your implementation? We love PR's :smiley:

stefanalund avatar Nov 30 '15 20:11 stefanalund

I would be happy to share all of them them once I do some cleanup...

marcin-sielski avatar Nov 30 '15 22:11 marcin-sielski

@marcin-sielski I'd like to see a solution for this as well. Everything 'functions' fine, but the feed looks pretty bad. I'd like to be able to adjust resolution, but it's not clear to me how to do it.

J-F-Far avatar Dec 02 '15 19:12 J-F-Far

@stefanalund @marcin-sielski @carterbryden Why we canot use the function of getUserMedia in our JS?

JS code as below:

var video_constraints = { mandatory: { maxHeight: 480, maxWidth: 640, minFrameRate: 30 }, optional: [] };

navigator.getUserMedia({ audio: false, video: video_constraints }, onsuccess);

Info link: https://webrtchacks.com/how-to-figure-out-webrtc-camera-resolutions/

bamboolsu avatar Dec 23 '15 01:12 bamboolsu

@Rugvip - how would you do this?

superdump avatar Dec 23 '15 08:12 superdump

It seems that this may have been implemented already but not published as it needed a new OpenWebRTC version.

superdump avatar Dec 23 '15 09:12 superdump

@bamboolsu we're working on the native side of things so we aren't getting the camera in a webview using js.

@superdump has it been committed anywhere we could take a look?

@marcin-sielski If you get a chance to PR that we'd be very grateful, thanks.

carterbryden avatar Dec 27 '15 23:12 carterbryden

Hi guys, we ended up switching to a webview and loading everything from the server, which gives us the same control as in-browser. I'd still be very interested in this if anyone ever feels like taking a crack at it, I'm not really sure where to start.

carterbryden avatar Jan 18 '16 18:01 carterbryden

Hey, guys it would be really cool if somebody can tell, what to modify in utils.java to reduce the quality because I am running the app on a smartglass and always getting:

02-10 13:29:45.478  22562-22576/org.app.remso E/g_printerr﹕ ==== Warning message start ====
02-10 13:29:45.502  22562-22576/org.app.remso E/g_printerr﹕ Warning in element sink.
02-10 13:29:45.502  22562-22576/org.app.remso E/g_printerr﹕ Warning: A lot of buffers are being dropped.
02-10 13:29:45.502  22562-22576/org.app.remso E/g_printerr﹕ Debugging info: gstbasesink.c(2793): gst_base_sink_is_too_late (): /GstPipeline:media-renderer-2/GstBin:video-renderer-bin-1/GstGLImageSinkBin:video-renderer-sink/GstGLImageSink:sink:
    There may be a timestamping problem, or this computer is too slow.
02-10 13:29:45.502  22562-22576/org.app.remso E/g_printerr﹕ ==== Warning message stop ====

@marcin-sielski what did you change in this file

SilentHunter124 avatar Feb 10 '16 18:02 SilentHunter124

Can we set the video resolution in Android sdk now? Thanks!

haichuand avatar Feb 17 '16 19:02 haichuand

02-10 13:29:45.478 22562-22576/org.app.remso E/g_printerr﹕ ==== Warning message start ==== 02-10 13:29:45.502 22562-22576/org.app.remso E/g_printerr﹕ Warning in element sink. 02-10 13:29:45.502 22562-22576/org.app.remso E/g_printerr﹕ Warning: A lot of buffers are being dropped. 02-10 13:29:45.502 22562-22576/org.app.remso E/g_printerr﹕ Debugging info: gstbasesink.c(2793): gst_base_sink_is_too_late (): /GstPipeline:media-renderer-2/GstBin:video-renderer-bin-1/GstGLImageSinkBin:video-renderer-sink/GstGLImageSink:sink: There may be a timestamping problem, or this computer is too slow. 02-10 13:29:45.502 22562-22576/org.app.remso E/g_printerr﹕ ==== Warning message stop ====

@SilentHunter124 hi, have you solve this problem

stanal avatar Jan 15 '18 18:01 stanal