Closed brummetj closed 4 years ago
WDA has built-in settings for image scaling and quality control. Check the documentation on mjpegScalingFactor
, mjpegCompressionFactor
, mjpegServerFramerate
and mjpegServerScreenshotQuality
items.
These must be new... can you point me to a link where this is all documented ?
Are these effecting the stream or the image response itself when using the appium server to get the image ?
E.i.. what’s the most optimal settings to set these at?.. and why would I want to use these settings instead of just running ffmpeg on my own and do my own image scaling / compression.
These must be new... can you point me to a link where this is all documented ?
http://appium.io/docs/en/advanced-concepts/settings/
Are these effecting the stream or the image response itself when using the appium server to get the image ?
These settings affect the WebDriverAgent server itself. E.g. image scaling is done by the mobile phone without affecting the receiving side.
E.i.. what’s the most optimal settings to set these at?.. and why would I want to use these settings instead of just running ffmpeg on my own and do my own image scaling / compression.
There is no such thing as optimal
there. Settings depend on the particular use-case the streaming is used for.
and why would I want to use these settings instead of just running ffmpeg on my own and do my own image scaling / compression.
Of course you are not limited in the way how to configure the client of the server. It is open source ;) I only mentioned the things that have been tested. Your scenario is totally valid, but is "custom". Which means it has not been tested and issues are quite possible there. Although, I cannot neither confirm nor reject they are bugs or not.
Perfect well thanks for answering my questions here!
I'll just need to do more testing for finding out what provides the highest performance, custom or the solution you provide. As well as most reliable...
Happy holidays
Consider moving the topic to Appium forum if you have further questions
The problem
I'm using the
driver.start_recording_screen()
functionality of a remote appium server to get a ffmpeg stream to the localhost:9100such as what you guys provided...
I use this to increase the screenshot time, but I take it a step further instead of calling
driver.get_screenshot_as_png()
, I remote ssh into the box and run a script that callsffmpeg -i http://localhost:9100/?action=stream -r 1 -vframes 1 -f image2pipe -hide_banner -loglevel panic
on a 5 second interval inside a loop for a certain duration...I grab that png buffer on stdout in python so I can reduce the image size down to half... e.i... from 15mb to 700kb, which will greatly increase the response time to get the image back to the client.
but what I'm seeing that the connection gets reset every time I trigger that action.
I didn't see it crash but I just want to understand why this stream should be getting disconnected from the client every time I interact with the stream via ffmpeg, and then will have to reestablish a new connection on an incremented port number?...
This might be something worth checking out! This might lead to future potential failures for our automation...
Environment
Details
If necessary, describe the problem you have been experiencing in more detail.
Appium logs
Code To Reproduce Issue [ Good To Have ]
start appium driver and run
driver.start_recording_screen()
Create a python script and run
python3 script.py