[FFmpeg-user] AWS Lambda h264 ratecontrol_init: can't open stats file
Douglas Rhiner
douglasrhiner at gmail.com
Thu Apr 18 20:19:45 EEST 2019
Moritz,
Thank you oh so much!
Got the general process working. Now i'll try to PIPE the source and output
file from/to S3.
On Tue, Apr 16, 2019 at 12:41 AM Moritz Barsnick <barsnick at gmx.net> wrote:
> Hi Douglas,
>
> On Mon, Apr 15, 2019 at 16:08:15 -0700, Douglas Rhiner wrote:
> > *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!
>
> libx264 isn't very good at log messages. It obviously has an issue
> accessing the "stats file", which is the two-pass file which you
> specified as "my_passlog_789789789_960_7000".
>
> To see in more detail what is going wrong, you could issue the command
> with strace (with a few extra command line parameters).
>
> My guess is: The command is being launched from a location (current
> directory) where it doesn't have write access. Therefore libx264 and/or
> ffmpeg cannot create "./my_passlog_789789789_960_7000". You should try
> giving the "-passlogfile" a filename with a full path to a writable
> location - "/tmp/my_passlog_789789789_960_7000" comes to mind as the
> most obvious choice.
>
> > *Pass two Command*
>
> You probably shouldn't be running the second command if the first one
> fails. When scripting, try to take return codes into consideration,
> otherwise your scripts may fall over terribly. (Not just in the case of
> using ffmpeg.) You might make assumptions that something worked - e.g.
> creating a directory or removing something - and that has effects on
> what happens afterwards.
>
> Cheers and good luck,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
--
Douglas Rhiner
JD Publishing
CTO
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