简体   繁体   English

Android-在mp4容器中混合原始h264

[英]android - mux raw h264 in mp4 container

I have raw h264 data of my frames and its presentationTimeUs and I want to mux data in mp4 container. 我有我的帧和它的presentationTimeUs的原始h264数据,我想在mp4容器中复用数据。 How can I do it with ffmpeg or any library except MediaMuxer ? 我该如何使用ffmpeg或MediaMuxer以外的任何库?

Update: I need a command to write h264 data of just one frame to mp4 container including presentatoinTimeUs 更新:我需要一个命令来将仅一帧的h264数据写入包括presentatoinTimeUs的mp4容器中

You can't write arbitrary H264 raw data without associated meta-information, either with ffmpeg or any library. 如果没有相关联的元信息,则不能使用ffmpeg或任何库编写任意H264原始数据。 Container such as MP4 exist so that a player knows how to handle that raw data (eg each frame's PTS, codec configuration, movie size, color format, etc), and more things that are not included in the raw compressed video stream. 存在诸如MP4之类的容器,以便播放器知道如何处理该原始数据(例如,每个帧的PTS,编解码器配置,电影大小,颜色格式等)以及未包含在原始压缩视频流中的更多内容。

You can however do the reverse, if you need to later analyze a compressor's bitstream: 但是,如果以后需要分析压缩器的比特流,则可以相反:

ffmpeg -i file.mp4 -f h264 out.h264 ffmpeg -i file.mp4 -f h264 out.h264

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM