簡體   English   中英

使用ffmpeg提取視頻流

[英]Using the ffmpeg to extract video stream

我嘗試從bbb-1920x1080-cfg02.mkv中提取視頻流

命令如下。

ffmpeg -i bbb-1920x1080-cfg02.mkv -map 0:0 -c copy bbb.mkv

但輸出文件無法與播放器(potplayer)一起播放

我使用ffmpeg -i bbb.mkv來檢查信息,並且有很多錯誤消息。

ffmpeg version N-80680-ga887fbb Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --enable-vaapi --disable-vda --disable-vdpau --disable-libxcb  --disable-ffplay --disable-ffserver --disable-ffprobe --disable-indev=jack --disable-outdev=sdl --enable-libx264 --enable-libx265 --enable-gpl --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-libxcb-shape --disable-x11grab
libavutil      55. 26.100 / 55. 26.100
libavcodec     57. 46.100 / 57. 46.100
libavformat    57. 40.101 / 57. 40.101
libavdevice    57.  0.101 / 57.  0.101
libavfilter     6. 46.102 /  6. 46.102
libswscale      4.  1.100 /  4.  1.100
libswresample   2.  1.100 /  2.  1.100
libpostproc    54.  0.100 / 54.  0.100
[hevc @ 0x3a64a60] No start code is found.
[hevc @ 0x3a64a60] Error splitting the input into NAL units.
[hevc @ 0x3a64a60] No start code is found.

即使我只是制作源文件的副本。

ffmpeg -i bbb-1920x1080-cfg02.mkv -map 0 -c copy bbb.mkv

輸出文件(bbb.mkv)仍然無法播放播放器(potplayer)它仍然有“[hevc @ 0x3a64a60]沒有找到開始代碼”錯誤。

正如該文件所述,它只是封裝了matroska格式。

有人可以教我如何找出這個問題嗎?

謝謝

您將不得不使用比特流過濾器。 好像FFmpeg沒有它就沒有編寫正確的編解碼器標簽。

ffmpeg -i bbb-1920x1080-cfg02.mkv -map 0:0 -c copy -vbsf hevc_mp4toannexb bbb.mkv

我嘗試了Gyan的ffmpeg解決方案,但它對我不起作用。 我還必須指定格式。 以下是我為了獲得H.265比特流所做的工作。 另外,我確實看到有人建議將輸出文件擴展名設置為.bin,但我喜歡h264 / h265,因為它更清楚了文件包含的是什么類型的比特流。

H.265至附件B.

ffmpeg -i test.mkv -c:v copy -bsf hevc_mp4toannexb -f hevc test.h265

H.264至附件B.

ffmpeg -i test.mkv -c:v copy -bsf h264_mp4toannexb -f h264 test.h264

注意:這也適用於.mov文件,也可能適用於其他格式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM