mp4封装灵感收集
2012-06-08 21:09
162 查看
1.使用ffmpeg
ffmpeg写container都是用avformat里的接口来做的,每帧数据都通过***Stream来写的,但你上面的代码很明显就不是如此,建议你直接在网上搜一下ffmpeg写文件, 这样的源码多如牛毛。
FFMpeg SDK 3.2可以编码h264
用ffmpeg把H.264码流封装成mp4
2009-07-23 18:25
例如,00 00 00 01 67 42 d0 0b 92 54 0a 0f 90 80 00 01 f4 00 00 13 88 47 8a 15 50 00 00 00 01 68 ce 3c 80
2.编码h264
ffmpeg0.7不支持,不知道以前的版本支持吗?
ffmpeg标准版本并没有AAC,H264的编码支持(解码是支持的),若要加上那些支持的话,你需要将相应的faac,x264等库编译好,然后在编译ffmpeg的时候将这些库的支持加上去(在ffmpeg编译的configurate命令里)。
C/C++ code
3.
我如果用***I文件格式来输出的话,就能播放视频画面
ffmpeg写container都是用avformat里的接口来做的,每帧数据都通过***Stream来写的,但你上面的代码很明显就不是如此,建议你直接在网上搜一下ffmpeg写文件, 这样的源码多如牛毛。
FFMpeg SDK 3.2可以编码h264
用ffmpeg把H.264码流封装成mp4
2009-07-23 18:25
代码参考 https://trac.handbrake.fr/browser/trunk/libhb/muxmp4.c 注意 st->codec->extradata里面一定要放入sps、pps两个NAL,否则转码出来的文件QuickTime无法播放 |
2.编码h264
ffmpeg0.7不支持,不知道以前的版本支持吗?
ffmpeg标准版本并没有AAC,H264的编码支持(解码是支持的),若要加上那些支持的话,你需要将相应的faac,x264等库编译好,然后在编译ffmpeg的时候将这些库的支持加上去(在ffmpeg编译的configurate命令里)。
C/C++ code
av_register_all(); fmt = guess_format(NULL, outfile, NULL); oc = av_alloc_format_context(); oc->oformat = fmt; snprintf(oc->filename, sizeof(oc->filename), "%s", outfile); video_st = NULL; audio_st = NULL; if (fmt->video_codec != CODEC_ID_NONE) { video_st = add_video_stream(oc, fmt->video_codec); } if (av_set_parameters(oc, NULL) < 0) { fprintf(stderr, "Invalid output format parameters\n"); exit(1); } if (video_st){ open_video(oc, video_st); } if (!(fmt->flags & ***FMT_NOFILE)) { if (url_fopen(&oc->pb,outfile, URL_WRONLY) < 0) { fprintf(stderr, "Could not open \'%s\'\n", outfile); exit(1); } } if(av_write_header(oc) < 0){ PRINTF("av_write_header failed\n"); return -1; } for(;;) { /* compute current audio and video time */ if (audio_st) audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den; else audio_pts = 0.0; if (video_st) video_pts = (double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den; else video_pts = 0.0; /* write interleaved audio and video frames */ if (!video_st || (video_st && audio_st && audio_pts < video_pts)) { PRINTF("write_audio_frame\n"
3.
我如果用***I文件格式来输出的话,就能播放视频画面
相关文章推荐
- 收集整理的openstack java封装 api的第三方实现的选择
- H264 编码封装成 MP4 格式 视频流 RTP 封包
- mpeg4ip的Mp4v2库移植到android系统上,实现h264封装到mp4的容器内
- ts、mp4、mov和flv媒体容器封装层的timebase分析
- jwplayer视频播放(FLV,mp4)实现和已封装好的php接口
- 成功在MP4封装的H264视频中提取能播放的裸流
- 转: FFMpeg 封装MP4 文件
- 使用mp4v2将aac音频h264视频数据封装成mp4开发心得
- 奋斗中的灵感之源的DotNetNuke研究手札收集
- 使用FFMPEG从MP4封装中提取视频流到.264文件 (转载)
- 2.2、jwplayer视频播放(FLV,mp4)实现和已封装好的php接口
- MP4 封装中 ctts BOX中( composition times)
- 使用FFMPEG从MP4封装中提取视频流到H264文件
- Android 音视频开发(五):使用 MediaExtractor 和 MediaMuxer API 解析和封装 mp4 文件
- 个人手写笔记,灵感收集.
- 使用FFMPEG从MP4封装中提取视频流到H264文件
- 收集整理的openstack java封装 api的第三方实现的选择
- ffmpeg封装PCM到MP4
- pcm+H264封装MP4代码
- 关于ffmpeg封装h264为mp4的问题