ffmpeg用法将视频编码为H264编解码器格式 [英] ffmpeg usage to encode a video to H264 codec format

查看:511
本文介绍了ffmpeg用法将视频编码为H264编解码器格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个* .mp4视频文件(MPEG4视频编解码器),我试图在Linux(版本-FFmpeg版本SVN-r0.5.1)上使用ffmpeg将其转换为H264视频编解码器格式(原始h.264格式). -4:0.5.1-1ubuntu1,版权(c)2000-2009 Fabrice Bellard,),使用命令行,如下所示,

I have a *.mp4 video file(MPEG4 video codec) and I am trying to convert this to a H264 video codec format(raw h.264 format) using ffmpeg on Linux(Version - FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard,) using command line as shown below,

ffmpeg -i input .mp4 output.h264 

但我收到一条错误消息-

but I get an error saying -

Unsupported codec for output stream #0.0

然后,当我尝试此选项时:

Then when i try this option:

ffmpeg -i input .mp4 -formats h264 output.h264 

它仍然不起作用,并给出-

it still does not work, and gives -

Seems stream 0 codec frame rate differs from container frame rate: 59.94 (5994/100) -> 29.97 (30000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Rapture.mp4':
  Duration: 00:02:06.44, start: 0.000000, bitrate: 26574 kb/s
    Stream #0.0(eng): Video: h264, yuv420p, 1920x1080, 29.97 tbr, 29.97 tbn, 59.94 tbc
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16

然后将打印出有关我们执行ffmpeg -formats

And then it prints out help on the formats which we get when we do ffmpeg -formats

当我查看帮助ffmpeg -formats时,我看到以下与H264文件格式和编解码器有关的信息:

When I checked the help, ffmpeg -formats, I see below information related to H264 file format and codec:

File format : 

DE h264            raw H.264 video format

Codecs:

D V D  h264         H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

我的问题:

  1. 如何将视频转换为H264编码的视频(原始H264视频格式)

  1. How can I convert the video to a H264 encoded video (raw H264 video format)

当我执行ffmpeg -formats时,会看到很多支持的编解码器的缩写,在编解码器名称/类型之前看到了很多的缩写,例如-DVDSEA,它们代表什么?

When I do ffmpeg -formats, I see many acronyms for the codecs supported, I see many acronyms before the codec name/type such as - D V D S E A, what do they stand for?

如何使用ffmpeg选项-vcodec-formats?

How to use the ffmpeg options -vcodec and -formats?

推荐答案

我相信您已经安装了libx264并配置了ffmpeg可以将视频转换为h264 ...然后可以尝试使用-vcodec libx264. .. -format选项用于显示可用格式,我认为这不是转换选项...

I believe you have libx264 installed and configured with ffmpeg to convert video to h264... Then you can try with -vcodec libx264... The -format option is for showing available formats, this is not a conversion option I think...

这篇关于ffmpeg用法将视频编码为H264编解码器格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆