ffmpeg产生空的MP4文件 [英] ffmpeg producing empty MP4 files

查看:122
本文介绍了ffmpeg产生空的MP4文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ffmpeg将MTS文件转换为MP4文件.该命令似乎在正确运行,但是生成的文件最终为空.

I am trying to use ffmpeg to convert MTS files to MP4 files. It seems as though the command is running correctly, but the resulting files end up being empty.

joshua@joshua-VirtualBox:~$ ffmpeg -i /media/sf_2017-04/SD_044/00007.MTS /media/sf_2017-04/SD_04/000007.mp4
ffmpeg version 0.8.17-4:0.8.17-0ubuntu0.12.04.2, Copyright (c) 2000-2014 the Libav developers
  built on Apr  1 2016 14:28:02 with gcc 4.6.3
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
Input #0, mpegts, from '/media/sf_2017-04/SD_044/00007.MTS':
  Duration: 00:01:17.07, start: 1.927822, bitrate: 25053 kb/s
  Program 1 
    Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 59.96 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
    Stream #0.2[0x1200]: Data: [144][0][0][0] / 0x0090
File '/media/sf_2017-04/SD_04/000007.mp4' already exists. Overwrite ? [y/N] y
[buffer @ 0x88772a0] w:1920 h:1080 pixfmt:yuv420p
ffmpeg -i /media/sf_2017-04/SD_044/00007.MTS /media/sf_2017-04/SD_04/000007.mp4
ffmpeg version 0.8.17-4:0.8.17-0ubuntu0.12.04.2, Copyright (c) 2000-2014 the Libav developers
  built on Apr  1 2016 14:28:02 with gcc 4.6.3
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
Input #0, mpegts, from '/media/sf_2017-04/SD_044/00007.MTS':
  Duration: 00:01:17.07, start: 1.927822, bitrate: 25053 kb/s
  Program 1 
    Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 59.96 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
    Stream #0.2[0x1200]: Data: [144][0][0][0] / 0x0090
File '/media/sf_2017-04/SD_04/000007.mp4' already exists. Overwrite ? [y/N] y
[buffer @ 0x88772a0] w:1920 h:1080 pixfmt:yuv420p
encoder 'aac' is experimental and might produce bad results.
Add '-strict experimental' if you want to use it.

推荐答案

在您的ffmpeg版本中,ffmpeg中的aac编解码器仍处于试验阶段,ffmpeg会自动为输出编解码器选择 aac ,因为您没有用 -c:a 指定.但是您需要手动启用它.

In your ffmpeg version, aac codec in ffmpeg is still experimental, ffmpeg automatically select aac for the output codec since you didn't specify with -c:a. But you need to manually enable it.

就像输出信息所示,添加额外的参数 -strict -2 -strict实验性即可.

Like the output information said, add extra parameters -strict -2 or -strict experimental will work.

这篇关于ffmpeg产生空的MP4文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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