Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate video on mobile viewport #1635

Closed
jaydub2099 opened this issue Jun 6, 2017 · 5 comments
Closed

Unable to generate video on mobile viewport #1635

jaydub2099 opened this issue Jun 6, 2017 · 5 comments
Labels

Comments

@jaydub2099
Copy link

Yesterday I updated the docker container we have been using for nightly sitespeed.io runs to 5.2.1 and added the --video and --speedIndex parameters to generate said video and metrics. We do runs for a given URL using 3 viewports for desktop, tablet, and mobile. I have looked at the output from the runs last night and the output shows errors for the ffmpeg video generation for every URL for the mobile viewport which is 375x667. The runs for desktop (1366x768) and tablet (768x1024) show no errors.

Here is output for one such run showing the ffmpeg error:

Google Chrome 58.0.3029.81
Mozilla Firefox 53.0
[2017-06-06 12:42:02] INFO: Versions OS: linux 3.19.0-18-generic nodejs: v6.9.1 sitespeed.io: 5.2.1 browsertime: 1.2.7 coach: 0.34.1
[2017-06-06 12:42:03] INFO: Starting chrome for analysing https://www.commonsensemedia.org/movie-reviews 3 time(s)
[2017-06-06 12:42:03] INFO: sudo tc qdisc add dev eth0 root netem delay 150ms loss 0% rate 1600kbps
[2017-06-06 12:42:03] INFO: Testing url https://www.commonsensemedia.org/movie-reviews run 1
[2017-06-06 12:42:05] INFO: sudo tc qdisc del dev eth0 root
[2017-06-06 12:42:05] ERROR: Error: Command failed: ffmpeg -hide_banner -an -y -framerate 60 -probesize 1M -video_size 375x601 -f x11grab -draw_mouse 0 -i :99.0+0,66 -c:v libx264 -pix_fmt yuv420p -profile:v main -movflags faststart -preset ultrafast /sitespeed.io/www.commonsensemedia.org/superbrowse-filtered/375x667-06-06-2017-05-42/pages/www.commonsensemedia.org/movie-reviews/data/video/0.mp4
[x11grab @ 0x5772fc0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':99.0+0,66':
Duration: N/A, start: 1496752925.354400, bitrate: N/A
Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 375x601, 60 fps, 1000k tbr, 1000k tbn, 1000k tbc
[libx264 @ 0x577d720] width not divisible by 2 (375x601)
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

at Promise.all.then.arr (/usr/src/app/node_modules/execa/index.js:208:11)
at process._tickCallback (internal/process/next_tick.js:103:7)

From previous event:
at startRecording (/usr/src/app/node_modules/browsertime/lib/support/video/ffmpegRecorder.js:52:18)
at Object.startRecordingX11 (/usr/src/app/node_modules/browsertime/lib/support/video/ffmpegRecorder.js:75:12)
at driver.get.then.then.then.then.then (/usr/src/app/node_modules/browsertime/lib/support/video/scripts/startVideo.js:43:40)
at ManagedPromise.invokeCallback_ (/usr/src/app/node_modules/selenium-webdriver/lib/promise.js:1384:14)
at TaskQueue.execute_ (/usr/src/app/node_modules/selenium-webdriver/lib/promise.js:3092:14)
at TaskQueue.executeNext_ (/usr/src/app/node_modules/selenium-webdriver/lib/promise.js:3075:27)
at asyncRun (/usr/src/app/node_modules/selenium-webdriver/lib/promise.js:2935:27)
at /usr/src/app/node_modules/selenium-webdriver/lib/promise.js:676:7
[2017-06-06 12:42:05] INFO: Render HTML for 0 page(s)
[2017-06-06 12:42:06] INFO: HTML stored in /sitespeed.io/www.commonsensemedia.org/superbrowse-filtered/375x667-06-06-2017-05-42
[2017-06-06 12:42:06] INFO: Finished analysing https://www.commonsensemedia.org/movie-reviews

@soulgalore
Copy link
Member

Hey @jaydub2099
think we have had something like this before, I've increased the probesize to 1M by default but it seems it was not enough then (https://ffmpeg.org/pipermail/ffmpeg-user/2014-May/021227.html). Lets make it configurable (or higher by default).

I tried to reproduce but worked on my local, do you run something like this:
docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io --video --speedIndex https://www.commonsensemedia.org/movie-reviews --browsertime.viewPort 768x1024

One thing in the log: I think you should switch to use Docker networks to setup the connectivity: https://www.sitespeed.io/documentation/sitespeed.io/browsers/#change-connectivity - tc inside the container only sets latency and upload speed, not download. Can you test doing that first and then if it doesn't do anything I'll increase the default probesize value.

Best
Peter

@jaydub2099
Copy link
Author

Just as a test I changed my viewport setting and reran the sitespeed.io runs and now the video is fine. Since the error message included this line:

[libx264 @ 0x577d720] width not divisible by 2 (375x601)

I thought maybe it was as simple as having a viewport that was an odd number. The viewport I had used was 375x667. I changed this to 376x668 and the runs completed with videos without error.

So a workaround does seem to exist here although it still seems odd to me that using a viewport that is not divisible by 2 (width or height probably) results in a fail is a problem.

@soulgalore
Copy link
Member

hey @jaydub2099 thanks, yep we should add a fix for that, it's how we configure ffmpeg/xvfb I guess.

@soulgalore soulgalore added the bug label Nov 24, 2017
@soulgalore
Copy link
Member

This should be moved to Browsertime.

@soulgalore
Copy link
Member

See sitespeedio/browsertime#565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants