本文介绍了如何将H264视频文件转换为带音频的MP4文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

How to convert H264 video file to MP4 file with audio.
When i am converting H264 to MP4, i could not get the audio when playing the video.





什么我试过了:



我尝试使用ffMPEG将H264文件转换为MP4文件。它转换但音频不会来。你能告诉我在C#.Net中可以实现的原因和方法。



What I have tried:

I tried converting H264 file to MP4 file using ffMPEG. Its converted but audio is not coming. can you tell me the reason and how it can be achieved in C#.Net.

推荐答案

ffmpeg -i GoodAudioInput.mp4 -c:a copy -vn -sn audio.m4a

获取视频流:

Get Video stream:

ffmpeg -i GoodVideoInput.mp4 -c:v copy -sn -an video.mp4

将两者合并:

Merge the two:

ffmpeg -i video.mp4 -i audio.m4a -c:v copy -c:a aac -strict experimental merged.mp4

重新同步音频:

To resync audio:

ffmpeg -i video.mp4 -itsoffset 3.0 -i audio.m4a -c:v copy -c:a aac -strict experimental merged.mp4

(将在3.0秒后制作音频)

(Will make audio 3.0 seconds later)


这篇关于如何将H264视频文件转换为带音频的MP4文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 18:24