Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8624 closed defect (invalid)

Codec Copy Reencodes AAC VBR Audio

Reported by: Amin Husni Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Codec Copy or Audio Codec Copy Reencodes AAC VBR Audio

Flow: .ts -> .mp4

Tried with -c:a copy and -codec copy and both does not give expected result.

The original .ts file has a VBR audio.
When copying into .mp4, it reencodes the audio into CBR and byte comparison for the audio track does not match with original AAC that comes from the .ts file.

How to reproduce:

%  ffmpeg -i .\sample_media.ts -c:v copy -c:a copy .\vacopy.mp4
ffmpeg git-2020-04-17-889ad93
built on gcc 9.3.1 (GCC) 20200328

Additional console log:

ffmpeg version git-2020-04-17-889ad93 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 80.100 / 58. 80.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[h264 @ 0000022e104ecfc0] missing picture in access unit with size 8
Input #0, mpegts, from '.\sample_media.ts':
  Duration: 00:00:04.05, start: 12.027933, bitrate: 6135 kb/s
    Stream #0:0[0x100]: Video: h264 (Main), yuv420p(tv, bt709/unknown/unknown, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101]: Audio: aac (LC), 44100 Hz, stereo, fltp, 229 kb/s
Output #0, mp4, to '.\vacopy.mp4':
  Metadata:
    encoder         : Lavf58.42.100
    Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709/unknown/unknown, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 229 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[NULL @ 0000022e104ecfc0] missing picture in access unit with size 8
[mp4 @ 0000022e10bd8040] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[mp4 @ 0000022e10bd8040] pts has no value
frame=  121 fps=0.0 q=-1.0 Lsize=    2955kB time=00:00:03.98 bitrate=6070.3kbits/s speed= 499x
video:2825kB audio:126kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.148198%

The issue might be similar to ticket #4546

Attachments (1)

small-sample-media.ts (2.4 MB ) - added by Amin Husni 5 years ago.
Original TS file with VBR

Change History (3)

comment:1 by Carl Eugen Hoyos, 5 years ago

Component: avcodecundetermined
Keywords: AAC MP4 TS removed
Resolution: invalid
Status: newclosed

AAC is stored diffrerently in mpegts and mov/mp4, no re-encoding is taking place for your command line.

by Amin Husni, 5 years ago

Attachment: small-sample-media.ts added

Original TS file with VBR

comment:2 by mkver, 5 years ago

To see that no reencoding is involved, take a look at the hashs of the decoded original audio as well as the decoded audio from the remuxed file (ffmpeg provides the hash muxer for this).

Note: See TracTickets for help on using tickets.