[FFmpeg-user] AWS Lambda h264 ratecontrol_init: can't open stats file

Douglas Rhiner douglasrhiner at gmail.com
Tue Apr 16 02:08:15 EEST 2019


I have done some rather extensive digging and can not seem to be able to
get this figured out. There are several SIMILAR instances, on this list and
others, with error expressions like I'm running into and I've tried taking
their solutions into account, over the past 2 days, to no avail. None of
the instances I've seen has been what I'd call "functionally similar",
though.

AWS Lambda Config: Python 3.7 with 2432 MB Memory. Triggered from S3 upload.
FFMPEG build from johnvansickle.com; ffmpeg-git-20190411-amd64-static
Zip uploaded via S3 with [binary, and ffmpeg_lambda.py].

Both passes ( below ) of the video encoding produce the exact same error. A
file is generated but it contains 0k.

*Pass One Command*
os.system('/tmp/ffmpeg -y -i /tmp/789789789/789789789.mp4 -c:v libx264
-strict -2 -b:v 7000k -maxrate 7000k -bufsize 5250.0k -vf scale=-2:960 -an
-pass 1 -passlogfile my_passlog_789789789_960_7000 -f mp4
/tmp/789789789/temp_789789789_960_7000')

   - [libx264 @ 0x5d81cc0] ratecontrol_init: can't open stats file
   - 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!

*Pass two Command*
os.system('/tmp/ffmpeg -y -i /tmp/789789789/789789789.mp4 -c:v libx264
-strict -2 -b:v 7000k -maxrate 7000k -bufsize 5250.0k -vf scale=-2:960 -c:a
aac -b:a 128k -pass 2 -passlogfile my_passlog_789789789_960_7000 -movflags
+faststart -f mp4 /tmp/789789789/960_7000.mp4')

   - [libx264 @ 0x5d81cc0] ratecontrol_init: can't open stats file
   - 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!


However, the last command ( below ) before the end of the Python script,
Audio Extraction,  works just fine and produces a valid file right where it
should be.
*Audio extraction Command*
os.system('/tmp/ffmpeg -y -i /tmp/789789789/789789789.mp4 -f mp3 -ab 192000
-vn /tmp/789789789/audio_file.mp3')

I have these same, exact commands working as-expected in a CentOS
environment vial python as well.

Any direction would be immensely appreciated.

-- 
Douglas Rhiner
C.530-448-2754
Skype.douglasrhiner
924 Incline Way Suite D
Incline Village, NV
89451
douglasrhiner at gmail.com


xplorit.com <https://www.xplorit.com>


wendyourway.com <https://www.wendyourway.com>


More information about the ffmpeg-user mailing list