FFmpeg With S3 Input URLs
November 26, 2018 • A solution to an FFmpeg error from limits on S3 URLs
I want to share a solution to a problem that had me scratching my head for far longer than I’d like to admit. I use FFmpeg to manipulate S3 assets and I use signed URLs as HTTP inputs. Specifically, I was concatenating multiple mp4s of different resolutions together, using complex_filter to concat+transcode into 1 resulting mp4. I was running into intermittent errors that looked like this:
I found no issues with the source videos. Being fairly new to FFmpeg at the time, I tried changing my FFmpeg version multiple times as well as all the various parameters in my command. Sometimes I had to re-run the same FFmpeg command multiple times in order to reproduce the error I was seeing. Turns out, the solution is a couple of flags before each input (
-reconnect 1 -reconnect_streamed 1):
I also found that without the
-xerror flag, my concatenate videos FFmpeg command would fail silently and omit whatever video hit that error. I always use this flag now.