Skip to content

Commit a34aa20

Browse files
committed
android 使用mp4容器
1 parent fdcebea commit a34aa20

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ijkmedia/ijkplayer/ff_ffplay.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5238,8 +5238,13 @@ int ffp_start_record(FFPlayer *ffp, const char *file_name)
52385238
av_log(ffp, AV_LOG_ERROR, "recording has started");
52395239
goto end;
52405240
}
5241+
5242+
#if defined(__ANDROID__)
5243+
avformat_alloc_output_context2(&ffp->m_ofmt_ctx, NULL, "mp4", file_name);
5244+
#else
5245+
avformat_alloc_output_context2(&ffp->m_ofmt_ctx, NULL, "mov", file_name);
5246+
#endif
52415247
// 初始化一个用于输出的AVFormatContext结构体
5242-
avformat_alloc_output_context2(&ffp->m_ofmt_ctx, NULL, "mov", file_name);
52435248
if (!ffp->m_ofmt_ctx) {
52445249
av_log(ffp, AV_LOG_ERROR, "===Could not create output context filename is %s\n", file_name);
52455250
goto end;

0 commit comments

Comments
 (0)