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

ffmpeg conversion runs even with video=false and fails on heights not divisible by two #565

Closed
BevanR opened this issue Apr 30, 2018 · 4 comments

Comments

@BevanR
Copy link

BevanR commented Apr 30, 2018

Running Browsertime on Travis with command: docker run --shm-size=1g --rm --volume "$(pwd)":/browsertime sitespeedio/browsertime --viewPort=1280x953 --skipHar --video=false --iterations=1 --resultDir=browsertime-results --pageCompleteCheck=\'return window.sv && sv.developer.measure === "done"\' http://172.17.0.1:5373/examples/alignments/50-sequences/?measure=static

Yields the following error.

[2018-04-30 00:06:41] Error running browsertime Error: Command failed: ffmpeg -i /browsertime/browsertime-results/video/0.mp4 -c:v libx264 -crf 23 -preset medium -vf format=yuv420p /browsertime/browsertime-results/video/tmp.mp4
ffmpeg version 3.4.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Debian 6.4.0-10) 20171112
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/browsertime/browsertime-results/video/0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:24.80, start: 0.000000, bitrate: 1352 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), gbrp(tv, gbr/unknown/unknown), 1280x887, 1350 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x50fd4a0] height not divisible by 2 (1280x887)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Indeed the height in the Browsertime --viewPort parameter has a height of 953 that is not divisible by two.

However, the --video parameter is false, so it shouldn't even care.

These are probably two separate bugs, but I figured I'd report them together to confirm before splitting out.

@soulgalore
Copy link
Member

Hi @BevanR thanks for reporting. It isn't 100% clear in the docs but it works like this: By default when you run in Docker both keeping the video and collecting visual metrics is turned on by default (and to collect the visual metrics you need the video) so to fully turn off using the video you need to turn them off both. In latest stable add --video false --speedIndex false. Let us update the CLI help in the coming release so it's easier to understand.

The pixel thing, yep, a PR to fix that would be great :)

Best
Peter

@fholzer
Copy link
Contributor

fholzer commented Feb 21, 2019

The h264 codec, thus the x264 encoder doesn't support video width or hight that isn't divisible by 2.
@soulgalore which of the below would you prefer?

  1. forcing the user to use width/height divisible by 2
  2. scaling the video
  3. padding the video by 1 row/column of pixels

@soulgalore
Copy link
Member

@fholzer what do you prefer? I think we should avoid 1, else it doesn't matter so much for me.

@fholzer
Copy link
Contributor

fholzer commented Feb 25, 2019

I'd go for padding the video.

fholzer added a commit to fholzer/browsertime that referenced this issue Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants