avformat/movenc: enable compressorname for mp4 mode

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
Zhao Zhili 2022-06-24 15:05:18 +08:00
parent 7c05b7951c
commit 2e6e28ebc1
6 changed files with 10 additions and 9 deletions

View File

@ -2122,7 +2122,9 @@ static void find_compressor(char * compressor_name, int len, MOVTrack *track)
|| (track->par->width == 1440 && track->par->height == 1080)
|| (track->par->width == 1920 && track->par->height == 1080);
if ((track->mode == MODE_AVIF || track->mode == MODE_MOV) &&
if ((track->mode == MODE_AVIF ||
track->mode == MODE_MOV ||
track->mode == MODE_MP4) &&
(encoder = av_dict_get(track->st->metadata, "encoder", NULL, 0))) {
av_strlcpy(compressor_name, encoder->value, 32);
} else if (track->par->codec_id == AV_CODEC_ID_MPEG2VIDEO && xdcam_res) {
@ -2211,7 +2213,6 @@ static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
avio_wb32(pb, 0); /* Data size (= 0) */
avio_wb16(pb, 1); /* Frame count (= 1) */
/* FIXME not sure, ISO 14496-1 draft where it shall be set to 0 */
find_compressor(compressor_name, 32, track);
avio_w8(pb, strlen(compressor_name));
avio_write(pb, compressor_name, 31);

View File

@ -1,9 +1,9 @@
71c4ff2e747fe6f8169ff29244fe181d *tests/data/lavf/lavf.mp4
a6e44724cab1c4b50c49b0fd227b87d3 *tests/data/lavf/lavf.mp4
312477 tests/data/lavf/lavf.mp4
tests/data/lavf/lavf.mp4 CRC=0x9d9a638a
3c5734ad6d05e4afc2ccefef1385e882 *tests/data/lavf/lavf.mp4
19cbdb02f2f3e35bae779e2323be1b8e *tests/data/lavf/lavf.mp4
321363 tests/data/lavf/lavf.mp4
tests/data/lavf/lavf.mp4 CRC=0xe8130120
07348e31d11d92396e1eedc48ea14802 *tests/data/lavf/lavf.mp4
8ab9dd09f02b6d8146a40fc3c918d979 *tests/data/lavf/lavf.mp4
312021 tests/data/lavf/lavf.mp4
tests/data/lavf/lavf.mp4 CRC=0x9d9a638a

View File

@ -1,4 +1,4 @@
a7e57333c57e0f8a551374b063a41d9e *tests/data/fate/vsynth1-mpeg4.mp4
7825630f9100ce18338dc598b56619ab *tests/data/fate/vsynth1-mpeg4.mp4
540105 tests/data/fate/vsynth1-mpeg4.mp4
f80ec173d37f2f91add031e95579a220 *tests/data/fate/vsynth1-mpeg4.out.rawvideo
stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200

View File

@ -1,4 +1,4 @@
b751a2d3b4e693ca39d4fafa0175fc9d *tests/data/fate/vsynth2-mpeg4.mp4
74ab83b391f9c90f7f00fe2c3dfb6b3d *tests/data/fate/vsynth2-mpeg4.mp4
159330 tests/data/fate/vsynth2-mpeg4.mp4
2645405bc5350acc85ad72f3352f5135 *tests/data/fate/vsynth2-mpeg4.out.rawvideo
stddev: 6.02 PSNR: 32.53 MAXDIFF: 89 bytes: 7603200/ 7603200

View File

@ -1,4 +1,4 @@
7ca3bbb8bed55d558346d258f5bea440 *tests/data/fate/vsynth3-mpeg4.mp4
963a2970c57e1c7d46e209d5392fbeec *tests/data/fate/vsynth3-mpeg4.mp4
26037 tests/data/fate/vsynth3-mpeg4.mp4
fc0d8c1e58d254031e6207dfcae8f867 *tests/data/fate/vsynth3-mpeg4.out.rawvideo
stddev: 9.66 PSNR: 28.43 MAXDIFF: 79 bytes: 86700/ 86700

View File

@ -1,4 +1,4 @@
a0d0edee19f6658d0e93d294e32a1a6f *tests/data/fate/vsynth_lena-mpeg4.mp4
954162c34c24abe7a8fa6bfadcbb7dee *tests/data/fate/vsynth_lena-mpeg4.mp4
119742 tests/data/fate/vsynth_lena-mpeg4.mp4
9a1e085d9e488c5ead0c940c9612a37a *tests/data/fate/vsynth_lena-mpeg4.out.rawvideo
stddev: 5.34 PSNR: 33.57 MAXDIFF: 83 bytes: 7603200/ 7603200