Столкнулся с тем, что некоторые видео не проходят конвертацию.
Вот сама команда
if($video['rotate'] == '0' || $video['rotate'] == '360' || $video['rotate'] == ''){$vr = '';}
if($video['rotate'] == '90'){$vr = '-vf "transpose=1"';} // 90 градусов по часовой
if($video['rotate'] == '180'){$vr = '-vf "transpose=1,transpose=1"';} // 180 градусов по часовой
if($video['rotate'] == '270'){$vr = '-vf "transpose=2"';} // 270 градусов по часовой
$cmd = 'ffmpeg -y -i '.$catUpl. '/'.$dirDn.'/noconvert_'.$video['realname'].' -map_metadata -1 -map 0:v:0 -map 0:a:0 -vcodec h264 -pix_fmt yuv420p -vsync 1 -async 1 -color_primaries 1 -color_trc 1 -colorspace 1 -vf scale="\'w=if(gt(a,16/9),640,-2):h=if(gt(a,16/9),-2,360)\'" '.$vr.' -crf 20 -preset medium -profile:v baseline -level 3.0 -maxrate 800k -bufsize 1200k -ac 2 -c:a libfdk_aac -b:a 128k -f mp4 -movflags +faststart '.$catUpl. '/'.$dirDn.'/'.$video['realname'].' 2>&1';
exec($cmd,$retRES);
Результат заношу в лог и получаю ошибку кодека.
Только я не могу понять что именно нужно сделать? Какой кодек отсутствует? Как исправить?
C ffmpeg знаком посредственно, все на форумах смотрел.
Лог кодированияffmpeg version 2.6.9 Copyright (c) 2000-2016 the FFmpeg developers, built with gcc 4.9.2 (Debian 4.9.2-10),
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security '
--extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree
--enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm
--enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree
--disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3
--enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb
--enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray
--enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig
--enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi
--enable-avresample --disable-htmlpages --disable-podpages --enable-libutvideo --enable-libfdk-aac --enable-libx265
--enable-libiec61883 --enable-vaapi --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu,
libavutil 54. 20.100 / 54. 20.100, libavcodec 56. 26.100 / 56. 26.100, libavformat 56. 25.101 / 56. 25.101,
libavdevice 56. 4.100 / 56. 4.100, libavfilter 5. 11.102 / 5. 11.102, libavresample 2. 1. 0 / 2. 1. 0,
libswscale 3. 1.101 / 3. 1.101, libswresample 1. 1.100 / 1. 1.100,
libpostproc 53. 3.100 / 53. 3.100, [mov,mp4,m4a,3gp,3g2,mj2 @ 0xd04bc0]
Could not find codec parameters for stream 0 (Video: none (av01 / 0x31307661), none, 320x240, 148 kb/s):
unknown codec, Consider increasing the value for the 'analyzeduration' and 'probesize' options,
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xd04bc0] Could not find codec parameters for stream 1 (Audio: none (Opus / 0x7375704F),
48000 Hz, 2 channels, 58 kb/s):
unknown codec, Consider increasing the value for the 'analyzeduration' and 'probesize' options,
/var/www/user/data/www/domen.pro/userUpload/6482/noconvert_I6W1Fsk41XJWUuhj4SxF.mp4:
could not find codec parameters, Guessed Channel Layout for Input Stream #0.1 : stereo,
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/user/data/www/domen.pro/userUpload/6482/noconvert_I6W1Fsk41XJWUuhj4SxF.mp4':,
Metadata:, major_brand : isom, minor_version : 512, compatible_brands: isomiso2mp41,
encoder : Lavf58.45.100, Duration: 00:00:54.32, start: 0.006500, bitrate: 214 kb/s,
Stream #0:0(und): Video: none (av01 / 0x31307661), none, 320x240, 148 kb/s, SAR 1:1 DAR 4:3, 30 fps, 30 tbr, 15360 tbn,
15360 tbc (default), Metadata:, handler_name : VideoHandler,
Stream #0:1(und): Audio: none (Opus / 0x7375704F), 48000 Hz, 2 channels, 58 kb/s (default),
Metadata:, handler_name : SoundHandler, No decoder for stream #0:0, filtering impossible, Error opening filters!;