ffmpeg - 如何使用 ffmpeg 生成编码的 HEVC 比特流?

标签 ffmpeg hevc bitstream

我能够使用 HEVC 将 YUV 文件编码为 mp4:

ffmpeg.exe -f rawvideo -s 1920x1080 -pix_fmt yuv420p -i input.yuv -c:v hevc -r 30 -x265-params crf=27 -vframes 300 -an -y test.mp4

这是 mp4box -info test.mp4 显示:

* Movie Info *
        Timescale 1000 - Duration 00:00:10.000
        1 track(s)
        Fragmented File: no
        File suitable for progressive download (moov before mdat)
        File Brand isom - version 512
        Created: UNKNOWN DATE   Modified: UNKNOWN DATE File has no MPEG4 IOD/OD

iTunes Info:
        Encoder Software: Lavf56.11.100

Track # 1 Info - TrackID 1 - TimeScale 15360 - Media Duration 00:00:10.000 Track has 1 edit lists: track duration is 00:00:10.000 Media Info: Language "Undetermined" - Type "vide:hev1" - 300 samples Visual Track layout: x=0 y=0 width=1920 height=1080 MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x23 HEVC Video - Visual Size 1920 x 1080
        HEVC Info: Profile Main @ Level 5 - Chroma Format 1
        NAL Unit length bits: 32 - general profile compatibility 0x60000000
        Parameter Sets: 1 VPS 1 SPS 1 PPS
        SPS resolution 1920x1080
        Bit Depth luma 8 - Chroma 8 - 1 temporal layers

但是我怎样才能获得可解码的比特流呢?我试过了

 mp4box -raw 1 test.mp4 -out out.bin

它给出:

Extracting MPEG-H HEVC stream to hevc

但是out.bin无法被HM或elecard解码。

谢谢

最佳答案

使用

ffmpeg -i input.mp4 -c:v hevc -f hevc out.bin

生成附件B字节流。这可以馈送到另一个解码器。

关于ffmpeg - 如何使用 ffmpeg 生成编码的 HEVC 比特流?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26662720/

相关文章:

haskell - Haskell 中的高效比特流

c# - 如何检查ffmpeg何时完成视频片段?

internet-explorer - FFMpeg 从 avi 到 mp4 的转换对于 safari 和 IE 浏览器的视频不成功

ios - Apple 视频编码器 (hevc) 是无损的吗?

video - HEVC:从输入二进制流中获取输入宽度和高度

python - 使用 python 将比特流保存到文件

python - 如何在Python中将1's and 0'的字符串以二进制形式保存到二进制文件中

c++ - LibAV FFmpeg C++ av_find_input_format ("dshow") 返回 nullptr

ffmpeg - 强制 FFMPEG 重用 gif 帧

ffmpeg - 使用 GPU 和 scale_npp 将 hevc 转码为 h264