sitespeedio / sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.
https://www.sitespeed.io/
MIT License
4.75k stars 603 forks source link

FFmpeg: Invalid duration specification for ss: NaN #2062

Closed mscrivo closed 6 years ago

mscrivo commented 6 years ago

Running the SiteSpeed 7.0.0 docker container with the following params:

docker-compose run sitespeed.io --graphite.host=graphite -n 3 -d 1 --preScript /preScript/login.js -b chrome <url> -c cable --visualMetrics --video --browsertime.connectivity.engine tc --browsertime.viewPort 1920x1200 --browsertime.chrome.args disk-cache-dir=/dev/null --browsertime.chrome.args disk-cache-size=1 --browsertime.chrome.args media-cache-size=1 --browsertime.pageCompleteCheck 'return (function() {try { return (Date.now() - window.performance.timing.loadEventEnd) > 15000;} catch(e) {} return true;})()'

Getting the following error:

ffmpeg version 4.0-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio                                                                                                                                                                                --cc=gcc-6 --enable-libxml2 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-lib                                                                                                                                                                               ass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband                                                                                                                                                                                --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enabl                                                                                                                                                                               e-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Invalid duration specification for ss: NaN

    at makeError (/usr/src/app/node_modules/execa/index.js:172:9)
    at Promise.all.then.arr (/usr/src/app/node_modules/execa/index.js:277:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

6.5.4 with the same args is working fine.

soulgalore commented 6 years ago

Hi @mscrivo thanks for the report.

There couple things here: First there's a bug that we don't find the start of the video, it has happened before but it will be easier to fix now in Browsertime 3.0 because the flow is easier. The thing is though it happens when you run on a really fast connection meaning no connectivity is set.

In your config you run configuration for setting up connectivity for sitespeed.io 5, I wonder if we could have some old documentation that is wrong somewhere? In 6.0 https://www.sitespeed.io/sitespeed.io-6.0/ we removed the tc option to set the connectivity, the reason is that it didn't set the connectivity correct. Now we recommend using Docker networks or Throttle see https://www.sitespeed.io/documentation/sitespeed.io/connectivity/ - however, we got a bug in Throttle #2063 so that needs to be fixed in a new release, that's why I think you should use Docker networks, we've been using that the last couple of years.

I'll look at the bug later on (first handing it better when it happens and also see if we can fix the original issue) but if you could setup so run on limited connection I'm pretty sure it will fix the issue.

Best Peter

mscrivo commented 6 years ago

Thanks @soulgalore, the only reason we still use tc is because I wasn't aware that it no longer worked :) Your documentation is great and I should read it more closely. I changed it to use throttle and that got rid of the above error, but I'm left with a video that is 1s long and essentially empty. Is that the bug you're talking about?

I'm playing around with the settings, including --browsertime.pageLoadStrategy normal to see what the results are.

soulgalore commented 6 years ago

Hi @mscrivo no the video should be ok. So you got an empty (white?) video that is 1 second long? I wonder if there's then a bug with how we handle preScriptst etc. Yep can you try just changing the pageLoadStategy , if that works, I'll have a look to revert that so we are using it by default. If not, I'll have a go at the problem.

Best Peter

mscrivo commented 6 years ago

Yeah, using 7.0.1, if I don't set pageLoadStrategy to normal, I get a short 2-3s video with mostly orange frames and then the last frame is the beginning of the app loading. I also get the following errors:

[2018-05-30 19:50:25] ERROR: {"frames":[{"tags":{"lavfi.signalstats.SATAVG":"80.1506"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1521"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1521"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1521"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1535"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1535"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1535"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4114"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4107"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4108"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4108"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4108"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4108"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4116"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4123"}},{"tags":{"lavfi.signalstats.SATAVG":"80.4123"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8191"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.8192"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1502"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1502"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1502"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1502"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1502"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"80.1503"}},{"tags":{"lavfi.signalstats.SATAVG":"4.99425"}},{"tags":{"lavfi.signalstats.SATAVG":"4.99425"}}]} [2018-05-30 19:50:25] ERROR: Error: Command failed: ffmpeg -nostdin -ss NaN -t NaN -i /sitespeed.io/sitespeed-result/app.domain.com/2018-05-30-19-49-33/pages/app.domain.com/mobileui/data/video/1.mp4 -c:v libx264 -an -vf drawtext=timecode='00\:00\:00\:00':rate=30: x=(w-280)/2: y=H-60:fontcolor=white:fontsize=48:box=1:boxcolor=0x000000AA,drawtext=enable='between(t,0,30)':x=(w-tw)/2: y=H-230:fontcolor=white:fontsize=26:box=1:boxcolor=0x000000AA:boxborderw=2:text='FirstVisualChange 0',drawtext=enable='between(t,0,30)':x=(w-tw)/2: y=H-200:fontcolor=white:fontsize=26:box=1:boxcolor=0x000000AA:boxborderw=2:text='SpeedIndex 0',drawtext=enable='between(t,0,30)':x=(w-tw)/2: y=H-170:fontcolor=white:fontsize=26:box=1:boxcolor=0x000000AA:boxborderw=2:text='VisualComplete85 0',drawtext=enable='between(t,0,30)':x=(w-tw)/2: y=H-140:fontcolor=white:fontsize=26:box=1:boxcolor=0x000000AA:boxborderw=2:text='LastVisualChange 0',drawtext=enable='between(t,0.514,30)':x=(w-tw)/2: y=H-110:fontcolor=white:fontsize=26:box=1:boxcolor=0x000000AA:boxborderw=2:text='DOMContentLoaded 514' -y /sitespeed.io/sitespeed-result/app.domain.com/2018-05-30-19-49-33/pages/app.domain.com/mobileui/data/video/tmp.mp4 ffmpeg version 4.0-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-libxml2 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 libpostproc 55. 1.100 / 55. 1.100 Invalid duration specification for ss: NaN

The command that produced the above, is:

docker-compose run sitespeed.io --cap-add=NET_ADMIN --graphite.host=graphite -n 3 -d 1 --preScript /preScript/login.js -b chrome https://app.domain.com/mobileui -c cable --visualMetrics --video --browsertime.connectivity.engine throttle --browsertime.viewPort 1920x1200 --browsertime.chrome.args disk-cache-dir=/dev/null --browsertime.chrome.args disk-cache-size=1 --browsertime.chrome.args media-cache-size=1 --browsertime.pageCompleteCheck return (function() {try { return (Date.now() - window.performance.timing.loadEventEnd) > 15000;} catch(e) {} return true;})()

If I change nothing else except the pageLoadStrategy to normal, then it seems to work fine and I get the video as expected. I'm fine with this for now, but in case you want someone to test any potential fixes, I'd be happy to do that.

Michael

soulgalore commented 6 years ago

And you added the wait in the login script? I've pushed the change (having normal as default) to dashboard.sitespeed.io and will let it run until tomorrow to know that I didn't introduce something new. Then we can push a new release and rollback to make it easier for everyone.

mscrivo commented 6 years ago

I did add the wait in the login script. I'll double check that's working properly.

On Thu, May 31, 2018, 8:31 AM Peter Hedenskog notifications@github.com wrote:

And you added the wait in the login script? I've pushed the change (having normal as default) to dashboard.sitespeed.io and will let it run until tomorrow to know that I didn't introduce something new. Then we can push a new release and rollback to make it easier for everyone.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sitespeedio/sitespeed.io/issues/2062#issuecomment-393514702, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQ0RLlluT05ERj10e3XFGSYyJRmmm_Fks5t3-KmgaJpZM4URgx- .

soulgalore commented 6 years ago

We changed now so 7.0.2 use the old pageLoadStrategy, that makes things easier for users in the long run.

mscrivo commented 6 years ago

thanks @soulgalore, appreciate all the help on this. I'm still struggling to get get consistent runs as I had on 6.5.4, but I'm convinced the problems are on my end, so you can close this if you like.

soulgalore commented 6 years ago

@mscrivo ok but please open another task if the metrics aren't consistent . I've seen that Firefox gives much more unstable metrics for Wikipedia (even though never version of FF is faster) but I mostly think that's because of how we load our JavaScript, the metrics are also more unstable on a C4.large on AWS than on a 2 cpu optimized droplet on DO. Chrome however are the same as before.