当视频文件中的开始/持续时间混乱时,ffmpeg vcodec复制不起作用 [英] ffmpeg vcodec copy does not work when start/duration is messed up in video file

查看:63
本文介绍了当视频文件中的开始/持续时间混乱时,ffmpeg vcodec复制不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的视频"文件显示以下带有ffprobe/ffmpeg的元数据:

My Video file shows below meta-data with ffprobe/ffmpeg:

Duration: 00:44:27.52, start: 1333.760000, bitrate: 335 kb/s
  Stream #0.0(und): Video: h264 (Main), yuv420p, 640x480, 25 tbr, 90k tbn, 50 tbc

注意:该文件不包含音频.

Note: The file does not contain audio.

我正在尝试使用ffmpeg/avconv将此视频文件转换为其他视频文件.

I am trying to convert this video file to other video file, using ffmpeg/avconv.

这有效:(但是将h.264视频编码为mpeg4)

This works: (but encodes h.264 video to mpeg4)

ffmpeg -i input.mp4 output.mp4

&它会生成适当持续时间的输出文件(44:27-1333秒= 22:14)

& it generates output file of proper duration (44:27 - 1333 seconds = 22:14)

这不起作用:

ffmpeg -i input.mp4 -vcodec copy output.mp4

生成不包含视频的文件.

Generates file without video.

输出包含:

$ avconv -i input.mp4 -vcodec copy output.mp4

avconv version 0.8.9-6:0.8.9-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Nov  9 2013 19:09:46 with gcc 4.8.1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2014-01-19 22:43:21
  Duration: 00:44:27.52, start: 1333.760000, bitrate: 335 kb/s
    Stream #0.0(und): Video: h264 (Main), yuv420p, 640x480, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      creation_time   : 2014-01-19 22:43:21
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2014-01-19 22:43:21
    encoder         : Lavf53.21.1
    Stream #0.0(und): Video: ![0][0][0] / 0x0021, yuv420p, 640x480, q=2-31, 90k tbn, 90k tbc
    Metadata:
      creation_time   : 2014-01-19 22:43:21
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press ctrl-c to stop encoding
frame=    0 fps=  0 q=-1.0 Lsize=       0kB time=10000000000.00 bitrate=   0.0kbits/s    
video:0kB audio:0kB global headers:0kB muxing overhead inf%

推荐答案

FFmpeg开发非常活跃

遇到问题时,最好从FFmpeg获取新版本的 ffmpeg ,以确保您不会遇到已解决的错误.

FFmpeg development is very active

When experiencing an issue it is best to get a new build of ffmpeg from FFmpeg to ensure that you are not encountering a bug that has already been fixed.

Ubuntu不使用FFmpeg中的 ffmpeg ,而是使用叉子中的旧版伪造版本.参见谁能告诉我ffmpeg,libav和avconv之间的区别和关系?

Ubuntu does not use ffmpeg from FFmpeg, but an old, fake version from a fork. See Who can tell me the difference and relation between ffmpeg, libav, and avconv?

您可以:

构建很容易.您只需下载,提取并执行(在 ffmpeg 之前注意 ./):

The build is easy. You just download, extract, and execute (notice the ./ before ffmpeg):

wget http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.$(date +"%F").tar.gz
tar xzvf ffmpeg.static.32bit.$(date +"%F").tar.gz
./ffmpeg -i input -codec copy -map 0 output

编译

编译 ffmpeg 允许您按自己的喜好对其进行自定义.编译指南是非侵入性的,并且易于撤消.

Compiling

Compiling ffmpeg allows you to customize it how you like. The compile guide is non-invasive and easy to undo.

如果最新的版本仍存在可疑的错误,则可以在 ffmpeg用户邮件列表中获得帮助,或在 FFmpeg错误跟踪器中进行搜索,并报告它是否是新错误.如果您报告该错误,请确保:

If a recent build still has the suspected bug then you can get help at the ffmpeg-user mailing list, or perform a search at the FFmpeg Bug Tracker and report it if it is a new bug. If you report the bug make sure to:

  • 检查您是否正在使用最新版本.
  • 提供完整的 ffmpeg 命令和完整的 ffmpeg 控制台输出.
  • 提供所有必需的样品.
  • 使用仍然显示问题的最小命令.
  • 提供任何其他有用的其他信息,这些其他信息将对试图重现此问题的其他人有用.
  • Check that you are using a recent build.
  • Provide the complete ffmpeg command and the complete ffmpeg console output.
  • Provide all necessary samples.
  • Use the minimal command that still shows the issue.
  • Provide any additional information that is useful for others who will attempt to duplicate the issue.

这篇关于当视频文件中的开始/持续时间混乱时,ffmpeg vcodec复制不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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