EricssonResearch / openwebrtc

A cross-platform WebRTC client framework based on GStreamer
http://www.openwebrtc.org
BSD 2-Clause "Simplified" License
1.8k stars 537 forks source link

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

Open carterbryden opened 8 years ago

carterbryden commented 8 years ago

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?

marcin-sielski commented 8 years ago

Hi,

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

Best Regards

Marcin Sielski

stefanalund commented 8 years ago

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

marcin-sielski commented 8 years ago

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

J-F-Far commented 8 years ago

@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.

bamboolsu commented 8 years ago

@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/

superdump commented 8 years ago

@Rugvip - how would you do this?

superdump commented 8 years ago

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

carterbryden commented 8 years ago

@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 commented 8 years ago

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.

SilentHunter124 commented 8 years ago

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

haichuand commented 8 years ago

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

stanal commented 6 years ago

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