| @@ -46,6 +46,9 @@ static const AVOption options[] = { · 45 unmodified lines |
| 46 | { "movflags", "MOV muxer flags", offsetof(MOVMuxContext, flags), AV_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, | 46 | { "movflags", "MOV muxer flags", offsetof(MOVMuxContext, flags), AV_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, |
| 47 | { "rtphint", "Add RTP hint tracks", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_RTP_HINT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, | 47 | { "rtphint", "Add RTP hint tracks", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_RTP_HINT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, |
| 48 | FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags), | 48 | FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags), |
| | 49 | { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, |
| | 50 | { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, |
| | 51 | { "iods_video_profile", "iods video profile atom.", offsetof(MOVMuxContext, iods_video_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, |
| 49 | { NULL }, | 52 | { NULL }, |
| 50 | }; | 53 | }; |
| 51 | | 54 | |
| @@ -1407,21 +1410,34 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVTrack *track, AVStream *st) · 1355 unmodified lines |
| 1407 | return updateSize(pb, pos); | 1410 | return updateSize(pb, pos); |
| 1408 | } | 1411 | } |
| 1409 | | 1412 | |
| 1410 | #if 0 | | |
| 1411 | /* TODO: Not sorted out, but not necessary either */ | | |
| 1412 | static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov) | 1413 | static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov) |
| 1413 | { | 1414 | { |
| 1414 | avio_wb32(pb, 0x15); /* size */ | 1415 | int i, has_audio = 0, has_video = 0; |
| | 1416 | int64_t pos = avio_tell(pb); |
| | 1417 | int audio_profile = mov->iods_audio_profile; |
| | 1418 | int video_profile = mov->iods_video_profile; |
| | 1419 | for (i = 0; i < mov->nb_streams; i++) { |
| | 1420 | if(mov->tracks[i].entry > 0) { |
| | 1421 | has_audio |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_AUDIO; |
| | 1422 | has_video |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_VIDEO; |
| | 1423 | } |
| | 1424 | } |
| | 1425 | if (audio_profile < 0) |
| | 1426 | audio_profile = 0xFF - has_audio; |
| | 1427 | if (video_profile < 0) |
| | 1428 | video_profile = 0xFF - has_video; |
| | 1429 | avio_wb32(pb, 0x0); /* size */ |
| 1415 | ffio_wfourcc(pb, "iods"); | 1430 | ffio_wfourcc(pb, "iods"); |
| 1416 | avio_wb32(pb, 0); /* version & flags */ | 1431 | avio_wb32(pb, 0); /* version & flags */ |
| 1417 | avio_wb16(pb, 0x1007); | 1432 | putDescr(pb, 0x10, 7); |
| 1418 | avio_w8(pb, 0); | 1433 | avio_wb16(pb, 0x004f); |
| 1419 | avio_wb16(pb, 0x4fff); | 1434 | avio_w8(pb, 0xff); |
| 1420 | avio_wb16(pb, 0xfffe); | 1435 | avio_w8(pb, 0xff); |
| 1421 | avio_wb16(pb, 0x01ff); | 1436 | avio_w8(pb, audio_profile); |
| 1422 | return 0x15; | 1437 | avio_w8(pb, video_profile); |
| | 1438 | avio_w8(pb, 0xff); |
| | 1439 | return updateSize(pb, pos); |
| 1423 | } | 1440 | } |
| 1424 | #endif | | |
| 1425 | | 1441 | |
| 1426 | static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov) | 1442 | static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov) |
| 1427 | { | 1443 | { |
| @@ -1829,7 +1845,8 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, · 401 unmodified lines |
| 1829 | } | 1845 | } |
| 1830 | | 1846 | |
| 1831 | mov_write_mvhd_tag(pb, mov); | 1847 | mov_write_mvhd_tag(pb, mov); |
| 1832 | //mov_write_iods_tag(pb, mov); | 1848 | if (mov->mode != MODE_MOV && !mov->iods_skip) |
| | 1849 | mov_write_iods_tag(pb, mov); |
| 1833 | for (i=0; i<mov->nb_streams; i++) { | 1850 | for (i=0; i<mov->nb_streams; i++) { |
| 1834 | if(mov->tracks[i].entry > 0) { | 1851 | if(mov->tracks[i].entry > 0) { |
| 1835 | mov_write_trak_tag(pb, &(mov->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL); | 1852 | mov_write_trak_tag(pb, &(mov->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL); |