VideoView不视频播放音频正确 [英] VideoView does not play Audio in Video properly
问题描述
我有一个 * MP4
文件,该文件是2分钟时间。现在,它已经音轨从30秒开始高达1.10分
。前 30岁,其余
之后 1.10min
是空白的。
I have an *.mp4
file which is duration of 2 min. Now it has audio track starting from 30 seconds upto 1.10 min
. The rest before 30s
and after 1.10min
is blank.
现在的问题是,当我尝试在 videoview
来播放或媒体播放器
那么,它起着从音频权开始播放视频,而从它的实际位置。我想这对多个电话相同的结果。
Now the problem is when I try to play it in videoview
or mediaplayer
then, it plays audio right from beginning of the video rather from its actual position. I tried this on multiple phones with same result.
当我在玩同一个视频 MXPlayer
或的Windows(VLC)
;它起着正常。
When I play the same video in MXPlayer
or in Windows(VLC)
; it plays properly.
如何解决这个问题?
修改
我用 -itsoffset
的ffmpeg命令
实现上面的视频。
I have used -itsoffset
command of Ffmpeg
for achieving above video.
ffmpeg -y -i a.mp4 -itsoffset 00:00:30 sng.m4a -map 0:0 -map 1:0 -c:v copy -preset ultrafast out.mp4
先谢谢了。
推荐答案
好吧最后我只需添加1选项解决了这个问题 -async
Ok finally I solved the problem by adding just 1 option -async
ffmpeg -y -i a.mp4 -itsoffset 00:00:30 sng.m4a -map 0:0 -map 1:0 -c:v copy -preset ultrafast -async 1 out.mp4
在默认情况下的音频/视频时间戳被拉伸相互匹配;这是我从intial音频起点的问题,甚至给以后 itsoffset
。
根据 ffmpeg的文件使用 异步1
纠正只有音频的初始时间戳。我知道,这个选项去precated;但无论如何它解决了我的情况。
As per Ffmpeg Doc using async 1
corrects the initial timestamp of audio only. I know that this option is deprecated; but anyhow it solved my case.
这篇关于VideoView不视频播放音频正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!