2015-10-13 487 views
0

我想將.mkv轉換爲.264。 我嘗試使用的ffmpeg做到這一點:ffmpeg轉換.mkv爲.264

ffmpeg -i input.mkv -vcodec copy -acodec copy output.264 

它的工作原理沒有錯誤,但是當我嘗試播放output.264使用ffplay:

ffplay -f h264 -i output.264 

ffplay的迴應是:

ffplay version N-75924-gd25c033 Copyright (c) 2003-2015 the FFmpeg developers 
    built with gcc 5.2.0 (GCC) 
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av 
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab 
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca -- 
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l 
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab 
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en 
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena 
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc 
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl 
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena 
ble-decklink --enable-zlib 
    libavutil  55. 3.100/55. 3.100 
    libavcodec  57. 5.100/57. 5.100 
    libavformat 57. 3.100/57. 3.100 
    libavdevice 57. 0.100/57. 0.100 
    libavfilter  6. 11.100/6. 11.100 
    libswscale  4. 0.100/4. 0.100 
    libswresample 2. 0.100/2. 0.100 
    libpostproc 54. 0.100/54. 0.100 
[h264 @ 03972220] sps_id 24 out of rangeq= 0KB sq= 0B f=0/0 
[h264 @ 03972220] missing picture in access unit with size 12836207 
[h264 @ 03972220] data partitioning is not implemented. Update your FFmpeg versi 
on to the newest one from Git. If the problem still occurs, it means that your f 
ile has a feature which has not been implemented. 
[h264 @ 03972220] If you want to help, upload a sample of this file to ftp://upl 
oad.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-deve 
[email protected]) 
[h264 @ 03972220] data partitioning is not implemented. Update your FFmpeg versi 
on to the newest one from Git. If the problem still occurs, it means that your f 
ile has a feature which has not been implemented. 
[h264 @ 03972220] If you want to help, upload a sample of this file to ftp://upl 
oad.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-deve 
[email protected]) 
[h264 @ 03972220] sps_id 24 out of range 
[h264 @ 03972220] data partitioning is not implemented. Update your FFmpeg versi 
on to the newest one from Git. If the problem still occurs, it means that your f 
ile has a feature which has not been implemented. 
[h264 @ 03972220] If you want to help, upload a sample of this file to ftp://upl 
oad.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-deve 
[email protected]) 
[h264 @ 03972220] no frame! 
[h264 @ 039696e0] Stream #0: not enough frames to estimate rate; consider increa 
sing probesize 
[h264 @ 039696e0] decoding for stream 0 failed 
[h264 @ 039696e0] Could not find codec parameters for stream 0 (Video: h264, non 
e): unspecified size 
Consider increasing the value for the 'analyzeduration' and 'probesize' options 
Contagion.264: could not find codec parameters 

我該如何修復它並將.mkv正確轉換爲.264?

回答

2

你不能把一個音軌爲原始H.264文件,你需要使用h264_mp4toannexb流過濾器流轉換爲附件B格式:

ffmpeg -i input.mkv -c:v copy -an -bsf:v h264_mp4toannexb out.264

比特流過濾器工作不重-encoding。

+0

謝謝@aergistal :) –

+0

我甚至嘗試將我的輸入文件重命名爲「input.mkv」,並逐字運行您的命令,但我總是得到以下錯誤: '無法找到合適的輸出格式.264' out.264:無效參數'。 :( – BrainSlugs83