问题描述
我们正在使用的硬件不支持播放mkv文件.因此,我需要将Matroska(mkv)视频文件转码为mp4视频文件.
The hardware on which we are working on doesnt support playing of mkv files.So i'm required to transcode Matroska (mkv) video filea to mp4 video file.
从网上关于转码的资料中了解到,我需要执行以下操作:
As I have understood from the material available online on transcoding,I'm required to do the following :
- 使用 matroskademux 元素分离出mkv文件的不同流.
- 使用可用的mkv解码器将音频和视频流解码为原始格式,并且
将此数据提供给mp4 Muxer元素,然后重新编码为所需格式.
- separate out different streams of mkv file using matroskademux element.
- decode the audio and Video streams into raw format using available mkv decoder and
supply this data to the mp4 Muxer element and re-encode to required format.
有人可以告诉我是否采用正确的方法吗?关于此的任何信息/链接都将非常有帮助.
Could anyone please tell me if I applying right approach?Any information/link on this would be very helpful.
vikram
推荐答案
根据Matroska文件中的内容,您可能根本不需要解码,只需重新混合即可.
Depending on what is in the Matroska file you might not need to decode it at all, just remux.
我假设视频是H264,所以只需重新混合即可.以下是用于gst-launch用于使用h264和mp3重新混合文件的示例管道.
I assume the video for instance is H264, so just remux that.Below is an example pipeline for gst-launch for remuxing a file with h264 and mp3.
gst-launch-0.10 -v filesrc location=$file \
! matroskademux name="demux" demux. ! h264parse ! queue \
! mp4mux name=mux ! filesink location=$file._out.mp4 demux. \
! mp3parse ! queue ! mux.`
您还可以查看 Transmageddon转码器(www.linuxrising.org),它应该可以为您提供所需的信息
You can also look at the Transmageddon transcoder (www.linuxrising.org) which should give you want you want.
这篇关于Gstreamer:将Matroska视频转码为mp4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!