Estou tentando escrever um script bash, que eu posso usar para iniciar a codificação do meu vídeo para o web player, e também fazer o registro para o arquivo quando ele for iniciado / finalizado.
Parece assim:
#!/bin/bash
>/var/www/stat/encode.txt
echo "on $(date +%s)" > /var/www/stat/encode.txt
ffmpeg -i 'suzumiya.mkv' -preset slow -crf 18 -c:v libx264 -c:a aac -strict -2 -movflags faststart -tune animation -profile:v baseline -vf "ass=suzumiya.ass" 'suzu.mp4'
echo "off $(date +%s)" > /var/www/stat/encode.txt
Quando eu o executo, isso me diz:
'NULL @ 0x20ad4c0] Unable to find a suitable output format for 'suzu.mp4
: Invalid argument
Quando eu apenas copio o código do ffmpeg para o console, ele funciona bem, sem erros. Onde pode haver problema?
Saída completa:
ffmpeg version N-63938-g684a915 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 13 2014 18:07:52 with gcc 4.7 (Debian 4.7.2-5)
configuration: --enable-gpl --enable-gray --enable-runtime-cpudetect --enable-bzlib --enable-gnutls --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-openal --enable-zlib --enable-nonfree --enable-version3 --enable-x11grab
libavutil 52. 89.100 / 52. 89.100
libavcodec 55. 66.100 / 55. 66.100
libavformat 55. 43.100 / 55. 43.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 8.100 / 4. 8.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, matroska,webm, from 'suzumiya.mkv':
Metadata:
title : The Melancholy of Haruhi Suzumiya: Special Ending
encoder : libebml v0.7.7 + libmatroska v0.8.0
creation_time : 2007-05-09 12:50:35
Duration: 00:01:11.97, start: 0.000000, bitrate: 3580 kb/s
Stream #0:0(jpn): Video: h264 (High), yuv420p, 704x480, SAR 229:189 DAR 5038:2835, 23.98 fps, 23.98 tbr, 1k tbn, 59.94 tbc (default)
Metadata:
title : The Melancholy of Haruhi Suzumiya: Special Ending
Stream #0:1(jpn): Audio: vorbis, 48000 Hz, stereo, fltp (default)
Metadata:
title : 2ch Vorbis
Stream #0:2(eng): Subtitle: ssa (default)
Metadata:
title : Styled ASS
Stream #0:3(eng): Subtitle: ssa
Metadata:
title : Styled ASS (Simple)
Stream #0:4(eng): Subtitle: subrip
Metadata:
title : Plain SRT
Stream #0:5: Attachment: ttf
Metadata:
filename : GosmickSansBold.ttf
mimetype : application/x-truetype-font
Stream #0:6: Attachment: ttf
Metadata:
filename : epmgobld_ending.ttf
mimetype : application/x-truetype-font
'NULL @ 0x20ad4c0] Unable to find a suitable output format for 'suzu.mp4
: Invalid argument
Tags bash video ffmpeg video-conversion linux