视频文件中的启动/持续时间混乱时,vcodec副本不起作用 [英] vcodec copy does not work when start/duration is messed up in video file

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

问题描述

我的视频文件使用ffprobe / ffmpeg显示以下元数据:

 持续时间:00:44:27.52,开始: 1333.760000,bitrate:335 kb / s 
Stream#0.0(und):Video:h264(Main),yuv420p,640x480,25 tbr,90k tbn,50 tbc
/ pre>

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



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



这样做:(但编码h.264视频到mpeg4)

  ffmpeg -i input.mp4 output.mp4 

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



这不起作用:

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

生成没有视频的文件。



输出包含:

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

avconv版本0.8.9-6:0.8.9-0ubuntu0.13.10.1,版权所有(c)2000-2013 Libav开发人员
建立于2013年11月9日19:09:46与gcc 4.8.1
从'input.mp4'输入#0,mov,mp4,m4a,3gp,3g2,mj2:
元数据:
major_brand:dash
minor_version:0
compatible_brands:iso6avc1mp41
creation_time:2014-01-19 22:43:21
持续时间: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
元数据:
creation_time:2014-01-19 22:43:21
输出#0,mp4,到'outpu t.mp4':
元数据:
major_brand:dash
minor_version:0
compatible_brands:iso6avc1mp41
creation_time:2014-01-19 22:43:21
编码器:Lavf53.21.1
流#0.0(und):视频:![0] [0] [0] / 0x0021,yuv420p,640x480,q = 2-31,90k tbn,90k tbc
元数据:
creation_time:2014-01-19 22:43:21
流映射:
流#0:0 - > #0:0(copy)
按ctrl-c停止编码
frame = 0 fps = 0 q = -1.0 Lsize = 0kB time = 10000000000.00 bitrate = 0.0kbits / s
video: 0kB音频:0kB全局头文件:0kB多路复用开销inf%


解决方案

FFmpeg开发非常活跃



遇到问题时,最好从FFmpeg中获取新的 ffmpeg 确保您没有遇到已经修复的错误。



Ubuntu使用fork



Ubuntu不使用FFmpeg的 ffmpeg ,而是从叉子使用旧的假版本。请参阅谁可以告诉我ffmpeg,libav和avconv之间的区别和关系?



获取 ffmpeg



您可以:





使用build



构建很简单。您只需下载,解压缩并执行(请注意 ./ ffmpeg ):

  wget http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.$(date +%F)。 gz 
tar xzvf ffmpeg.static.32bit $(date +%F)tar.gz
./ffmpeg -i输入-codec copy -map 0输出



编译



编译 ffmpeg 允许你自定义你喜欢的。编译指南是非侵入性且易于撤消。



报告错误



如果最近的版本还在有可疑的错误,那么您可以在 ffmpeg-user邮件列表获得帮助,或者执行搜索 FFmpeg Bug Tracker ,并报告它是否是一个新的错误。如果您报告错误,请确保:




  • 检查您是否使用最近的版本。

  • 提供完整的 ffmpeg 命令和完整的 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.

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

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

ffmpeg -i input.mp4 output.mp4

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

This does not work:

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

Generates file without video.

The output contains:

$ 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 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 uses a fork

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?

Get ffmpeg

You can:

Using the build

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

Compiling

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

Reporting a bug

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:

  • 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.

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

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