源视频和减去音频的持续时间不同 [英] Duration of source video and subtracted audio are different

查看:75
本文介绍了源视频和减去音频的持续时间不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

源视频和减去的WAV音频的持续时间不同,为什么?

The duration of source video and subtracted wav audio is different , why?

我正在从音频中重新组织字幕,我需要将字幕重新添加到视频中.所以我希望音频和视频的持续时间相同.

I'm recorgnizing subtitle from audio, and I need to add subtitle back to video. So I want the duration of audio and video the same.

ffmpeg -i http://cdn.live.360.cn/huikan_news/vod-media/_XW_203286B417B7C6466B3B_20160627185953.m3u8 -vn test.wav -y

我的CLI:

[zhangpengcheng@mobiledev03v ifly]$ ffprobe http://cdn.live.360.cn/huikan_news/vod-media/_XW_203286B417B7C6466B3B_20160627185953.m3u8 2>&1 | grep Duration
  Duration: 00:06:51.99, start: 1.400000, bitrate: 0 kb/s


[zhangpengcheng@mobiledev03v ifly]$ ffmpeg -i http://cdn.live.360.cn/huikan_news/vod-media/_XW_203286B417B7C6466B3B_20160627185953.m3u8 -vn test.wav -y
ffmpeg version 3.1.3 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
  configuration: --prefix=./build/ --enable-shared --enable-static --enable-libx264 --enable-avisynth --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libopencv --enable-librtmp --enable-gpl --enable-nonfree
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, hls,applehttp, from 'http://cdn.live.360.cn/huikan_news/vod-media/_XW_203286B417B7C6466B3B_20160627185953.m3u8':
  Duration: 00:06:51.99, start: 1.400000, bitrate: 0 kb/s
  Program 0 
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p(tv, smpte170m/bt709/bt709), 668x376, 15 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp, 65 kb/s
[wav @ 0x10182e0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, wav, to 'test.wav':
  Metadata:
    ISFT            : Lavf57.41.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
    Metadata:
      encoder         : Lavc57.48.101 pcm_s16le
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
size=   31904kB time=00:06:51.84 bitrate= 634.6kbits/s speed= 146x    
video:0kB audio:31904kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000239%


[zhangpengcheng@mobiledev03v ifly]$ ffprobe test.wav 2>&1 | grep Duration
  Duration: 00:06:10.40, bitrate: 705 kb/s

推荐答案

原始音频中似乎存在间隙.

Looks like there are gaps in the original audio.

使用

ffmpeg -i http://cdn.live.360.cn/huikan_news/vod-media/_XW_203286B417B7C6466B3B_20160627185953.m3u8 -af aresample=async=1 -vn test.wav -y

音频过滤器将填补空白.

The audio filter will fill in the gaps.

这篇关于源视频和减去音频的持续时间不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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