[GH-ISSUE #137] Recordings not stored properly #96

Closed
opened 2026-03-01 15:40:25 +03:00 by kerem · 13 comments
Owner

Originally created by @bonigarcia on GitHub (Jan 9, 2019).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/137

Operating System
Ubuntu 18.04.1 LTS

Docker Image
butomo1989/docker-android-x86-8.1:1.6-p0

Docker Version
Docker version 17.05.0-ce, build 89658be

Docker Command to start docker-android

docker run --rm -p 4444:4444 selenium/hub:3.141.59

... and then:

docker run --rm --privileged -p 6080:6080 -p 4723:4723 -e APPIUM=true -e CONNECT_TO_GRID=true -e MOBILE_WEB_TEST=true -e DEVICE="Samsung Galaxy S6" -e AUTO_RECORD=true -e APPIUM_HOST="172.17.0.1" -e APPIUM_PORT=4723 -e SELENIUM_HOST="172.17.0.1" -e SELENIUM_PORT=4444 -v $PWD:/tmp/video butomo1989/docker-android-x86-8.1:1.6-p0

Expected Behavior

I want to run the following test against the Selenium Server at http://localhost:4444/wd/hub and get the MP4 recording of the session in the folder ($PWD) running the commands before.

Actual Behavior

Most of the times, I get the error reported on #135 when running the test. Strangely, if the test execution is repeated over and over, from time to time Appium Server manages to response, and the test passes.

Nevertheless, in this case, I would expect to get a MP4 recording of the session in my local folder. That file exists, but its content is trimmed. It seems it is only recorded until the beginning of the test (only 200 ms according to mediainfo).

$ mediainfo 09_01_2019_05_38_11.mp4 
General
Complete name                            : 09_01_2019_05_38_11.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 176 KiB
Duration                                 : 200 ms
Overall bit rate                         : 7 217 kb/s
Writing application                      : Lavf57.83.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High 4:4:4 Predictive@L4
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 200 ms
Bit rate                                 : 7 183 kb/s
Width                                    : 1 599 pixels
Height                                   : 899 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 15.000 FPS
Chroma subsampling                       : 4:4:4
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.333
Stream size                              : 175 KiB (100%)
Writing library                          : x264 core 152 r2854 e9a5903
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=4 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=15 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Originally created by @bonigarcia on GitHub (Jan 9, 2019). Original GitHub issue: https://github.com/budtmo/docker-android/issues/137 **Operating System** Ubuntu 18.04.1 LTS **Docker Image** butomo1989/docker-android-x86-8.1:1.6-p0 **Docker Version** Docker version 17.05.0-ce, build 89658be **Docker Command to start docker-android** > docker run --rm -p 4444:4444 selenium/hub:3.141.59 ... and then: > docker run --rm --privileged -p 6080:6080 -p 4723:4723 -e APPIUM=true -e CONNECT_TO_GRID=true -e MOBILE_WEB_TEST=true -e DEVICE="Samsung Galaxy S6" -e AUTO_RECORD=true -e APPIUM_HOST="172.17.0.1" -e APPIUM_PORT=4723 -e SELENIUM_HOST="172.17.0.1" -e SELENIUM_PORT=4444 -v $PWD:/tmp/video butomo1989/docker-android-x86-8.1:1.6-p0 ## Expected Behavior I want to run the following [test](https://github.com/bonigarcia/webdrivermanager-examples/blob/master/src/test/java/io/github/bonigarcia/wdm/test/AndroidTest.java) against the Selenium Server at http://localhost:4444/wd/hub and get the MP4 recording of the session in the folder (`$PWD`) running the commands before. ## Actual Behavior Most of the times, I get the error reported on #135 when running the test. Strangely, if the test execution is repeated over and over, from time to time Appium Server manages to response, and the test passes. Nevertheless, in this case, I would expect to get a MP4 recording of the session in my local folder. That file exists, but its content is trimmed. It seems it is only recorded until the beginning of the test (only 200 ms according to `mediainfo`). ``` $ mediainfo 09_01_2019_05_38_11.mp4 General Complete name : 09_01_2019_05_38_11.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 176 KiB Duration : 200 ms Overall bit rate : 7 217 kb/s Writing application : Lavf57.83.100 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High 4:4:4 Predictive@L4 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, ReFrames : 4 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 200 ms Bit rate : 7 183 kb/s Width : 1 599 pixels Height : 899 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 15.000 FPS Chroma subsampling : 4:4:4 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.333 Stream size : 175 KiB (100%) Writing library : x264 core 152 r2854 e9a5903 Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=4 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=15 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 ```
kerem 2026-03-01 15:40:25 +03:00
Author
Owner

@budtmo commented on GitHub (Jan 9, 2019):

does it work perfectly on the previous version of docker image? @bonigarcia

<!-- gh-comment-id:452717519 --> @budtmo commented on GitHub (Jan 9, 2019): does it work perfectly on the previous version of docker image? @bonigarcia
Author
Owner

@bonigarcia commented on GitHub (Jan 9, 2019):

@butomo1989 I don't know. I've been a long time without testing it manually. I think in the 1.3-p5 version of the images that was working, but I'm not sure.

<!-- gh-comment-id:452718849 --> @bonigarcia commented on GitHub (Jan 9, 2019): @butomo1989 I don't know. I've been a long time without testing it manually. I think in the `1.3-p5` version of the images that was working, but I'm not sure.
Author
Owner

@budtmo commented on GitHub (Jan 16, 2019):

It happens since version 1.6-p0.
Please use this 1.5-p6 version for using video-recording feature

<!-- gh-comment-id:454772206 --> @budtmo commented on GitHub (Jan 16, 2019): It happens since version [1.6-p0](https://github.com/butomo1989/docker-android/releases/tag/1.6-p0). Please use this [1.5-p6](https://github.com/butomo1989/docker-android/releases/tag/) version for using video-recording feature
Author
Owner

@bonigarcia commented on GitHub (Mar 31, 2019):

Is there any plan to solve this bug?

<!-- gh-comment-id:478392373 --> @bonigarcia commented on GitHub (Mar 31, 2019): Is there any plan to solve this bug?
Author
Owner

@mehrdad-abdoli commented on GitHub (Apr 17, 2019):

@budtmo does this bug has been fixed in lateset version?

<!-- gh-comment-id:483950510 --> @mehrdad-abdoli commented on GitHub (Apr 17, 2019): @budtmo does this bug has been fixed in lateset version?
Author
Owner

@budtmo commented on GitHub (May 3, 2019):

Hi,

The bug is not fixed yet. It would be great if someone can help to solve this issue.

<!-- gh-comment-id:489122713 --> @budtmo commented on GitHub (May 3, 2019): Hi, The bug is not fixed yet. It would be great if someone can help to solve this issue.
Author
Owner

@ciekawy commented on GitHub (May 24, 2019):

this seems to happen intermittently - I was able to play one recording but not the other

<!-- gh-comment-id:495684673 --> @ciekawy commented on GitHub (May 24, 2019): this seems to happen intermittently - I was able to play one recording but not the other
Author
Owner

@mehrdad-abdoli commented on GitHub (May 28, 2019):

@budtmo I really needs video recording and can not solve this problem can you plz help to fix this or at least comment how can it be fixed?

<!-- gh-comment-id:496430297 --> @mehrdad-abdoli commented on GitHub (May 28, 2019): @budtmo I really needs video recording and can not solve this problem can you plz help to fix this or at least comment how can it be fixed?
Author
Owner

@ciekawy commented on GitHub (May 28, 2019):

I think this may depend on the particular image / Android version. for 8.0 it all works well for me (I thought it's not but I found I made stupid mistake to retrieve the video from the container in the cloud) - ideally the /tmp/video should be mapped as volume to local folder

<!-- gh-comment-id:496565243 --> @ciekawy commented on GitHub (May 28, 2019): I think this may depend on the particular image / Android version. for 8.0 it all works well for me (I thought it's not but I found I made stupid mistake to retrieve the video from the container in the cloud) - ideally the `/tmp/video` should be mapped as volume to local folder
Author
Owner

@ciekawy commented on GitHub (May 28, 2019):

also one general thing (which may be related) is that modern ffmpeg should be terminated with SIGINT to complete the recording well (not sure about the source of that information though...)

<!-- gh-comment-id:496576752 --> @ciekawy commented on GitHub (May 28, 2019): also one general thing (which may be related) is that modern `ffmpeg` should be terminated with `SIGINT` to complete the recording well (not sure about the source of that information though...)
Author
Owner

@budtmo commented on GitHub (May 29, 2019):

Hi @mehrdad-abdoli @ciekawy ,

The implementation can be found here. It would be great if you guys can help on fixing this issue and create a PR. :)

<!-- gh-comment-id:496916748 --> @budtmo commented on GitHub (May 29, 2019): Hi @mehrdad-abdoli @ciekawy , The implementation can be found [here](https://github.com/budtmo/docker-android/blob/master/src/record.sh). It would be great if you guys can help on fixing this issue and create a PR. :)
Author
Owner

@witness-fibonacci commented on GitHub (Aug 3, 2019):

@budtmo
in record.sh change this line
ffmpeg -video_size 1599x899 -framerate 15 -f x11grab -i $DISPLAY $VIDEO_PATH/$name -y
to:
ffmpeg -video_size 1598x898 -framerate 15 -f x11grab -i $DISPLAY $VIDEO_PATH/$name -y

<!-- gh-comment-id:517917298 --> @witness-fibonacci commented on GitHub (Aug 3, 2019): @budtmo in record.sh change this line ffmpeg -video_size 1599x899 -framerate 15 -f x11grab -i $DISPLAY $VIDEO_PATH/$name -y to: ffmpeg -video_size 1598x898 -framerate 15 -f x11grab -i $DISPLAY $VIDEO_PATH/$name -y
Author
Owner

@budtmo commented on GitHub (Aug 9, 2019):

Hi @witness-fibonacci ,

Thank you for the hint. could you send a PR for that?

<!-- gh-comment-id:519823467 --> @budtmo commented on GitHub (Aug 9, 2019): Hi @witness-fibonacci , Thank you for the hint. could you send a PR for that?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-android#96
No description provided.