capsule icon indicating copy to clipboard operation
capsule copied to clipboard

Cannot open "capture.mp4" when starting record

Open kennygoff opened this issue 8 years ago • 2 comments

I've followed the build directions and was able to build capsulerun. However when pressing F9 to record, ffmpeg is throwing an error when opening the "capture.mp4" file to write.

The error stems from the call to avio_open and it's PROTOCOL_NOT_FOUND. Doing some digging it seems that ffmpeg needs to be built with different configuration options, possibly --enable-protocol=file. I ran out of time to dig further and I don't know how the cmake provided ffmpeg is built, so I don't know exactly what could fix it, and I have not tried rebuilding ffmpeg with a different configuration.

Error location in source:

// In: capsulerun/src/encoder.cc

/* open the output file, if needed */
ret = avio_open(&oc->pb, output_path, AVIO_FLAG_WRITE);
if (ret < 0) {
  Log("Could not open '%s'", output_path);
  exit(1);
}

Environment notes:

  • macOS Sierra
  • FFmpeg was also installed via homebrew initially, but I uninstalled that version when trying to debug
  • Launched with a .app game

Research references:

kennygoff avatar Jul 21 '17 00:07 kennygoff

Ah, that's what I get for being smart and trying to get the smallest macOS ffmpeg+x264 build for capsule.

Brb cutting a new build that actually contains the file protocol!

By the way, thanks a lot for the exemplary report - I wish all GitHub issues were like this :)

fasterthanlime avatar Jul 21 '17 07:07 fasterthanlime

Hmm, --enable-protocol=file is definitely in my usual ffmpeg configure options https://gist.github.com/fasterthanlime/4dd42d376bc7f0bb769114b9b28f72a3 - that's fishy.

I'll keep investigating, ran into #55 while trying to reproduce.

fasterthanlime avatar Jul 21 '17 08:07 fasterthanlime