Opened 6 years ago

Closed 20 months ago

#7311 closed defect (fixed)

mp4 regression when remuxing ac-3

Reported by: Mista_D Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mov regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

When extracting AC3 track and saving it to mp4, the wrong type of ac-3 packet is included in MOOV.

packet header in stsd in MOOV set to 'AC-3' instead of 'ac-3'

Section 5.6.1.1.2 of http://uvcentral.com/sites/default/files/files/PublicSpecs/CFFMediaFormat-2_1.pdf

ffmpeg -i test.mpg -map a -c copy ac3.mp4
ac4.mp4 HEX offset 1227D-12280: "AC-3"

ffmpeg -i test.mpg -map a -c copy ac3.ac3
ffmpeg -i ac3.ac3 -c copy 2step.mp4
2step.mp4 HEX offset 1227D-12280: "ac-3"

How can ac-3 be set properly in MP4's MOOV packets when extracting AC3 track from MPG to MP4 please?

Attachments (4)

2step.mp4 (73.0 KB ) - added by Mista_D 6 years ago.
2 step result
test1.mpg (1.0 MB ) - added by Mista_D 6 years ago.
source file (smaller version due to size restriction)
ac3.mp4 (73.0 KB ) - added by Mista_D 6 years ago.
staight extraction to AC3 with wrong MOOV stsd
ac3.ac3 (72.2 KB ) - added by Mista_D 6 years ago.
temp ac3 file for 2 step process.

Download all attachments as: .zip

Change History (10)

by Mista_D, 6 years ago

Attachment: 2step.mp4 added

2 step result

by Mista_D, 6 years ago

Attachment: test1.mpg added

source file (smaller version due to size restriction)

by Mista_D, 6 years ago

Attachment: ac3.mp4 added

staight extraction to AC3 with wrong MOOV stsd

by Mista_D, 6 years ago

Attachment: ac3.ac3 added

temp ac3 file for 2 step process.

comment:1 by Mista_D, 6 years ago

Same problem detected with version 4.0.1

FFmpeg401 -y -i test1.mpg -c copy -map a ac3.mp4

ffmpeg version 4.0.1 Copyright (c) 2000-2018 the FFmpeg developers

built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)


libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100

Input #0, mpegts, from '2.ts':

Duration: 00:01:40.02, start: 1.400000, bitrate: 54349 kb/s
Program 1

Metadata:

service_name : Service01
service_provider: FFmpeg

Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 48700 kb/s, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s

[mp4 @ 0x2f5b040] track 0: codec frame size is not set
Output #0, mp4, to 'ac3.mp4':

Metadata:

encoder : Lavf58.12.100
Stream #0:0(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 384 kb/s

Stream mapping:

Stream #0:1 -> #0:0 (copy)

Press [q] to stop, ? for help
size= 4688kB time=00:01:39.96 bitrate= 384.2kbits/s speed= 222x
video:0kB audio:4688kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.015208%

comment:2 by Carl Eugen Hoyos, 6 years ago

The issue you see is not reproducible with current FFmpeg git head?

comment:3 by Mista_D, 6 years ago

This seems to work:
FFmpeg401 -y -drc_scale 0 -i source.ts -c copy -map a -map_metadata -1 ac3.mp4

Version 0, edited 6 years ago by Mista_D (next)

comment:4 by Mista_D, 6 years ago

Resolution: worksforme
Status: newclosed

comment:5 by Carl Eugen Hoyos, 6 years ago

Keywords: mov regression added; moov removed
Priority: normalimportant
Reproduced by developer: set
Resolution: worksforme
Status: closedreopened
Summary: wrong MOOV stsdmp4 regression when remuxing ac-3
Version: unspecifiedgit-master

Regression since e199d90da6473abc0d010797b14f2ae2c9811d34, see also tickets #6897 and #7079.

comment:6 by Balling, 20 months ago

Resolution: fixed
Status: reopenedclosed

packet header in stsd in MOOV set to 'AC-3' instead of 'ac-3'

Does not happen anymore. Fixed in 4cfb01d6ae545cec4a507113a6cbcf3b6e727e94 (did not check the commit).

Note: See TracTickets for help on using tickets.