VideoView不视频播放音频正确

编程入门 行业动态 更新时间:2024-10-10 07:32:26
本文介绍了VideoView不视频播放音频正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 * 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不视频播放音频正确

本文发布于:2023-11-27 18:50:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639189.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视频播放   音频   正确   VideoView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!