I'm using ffmpeg version 2.8.11 to convert an AVC/AAC video to HEVC/AAC: with the command ffmpeg -loglevel error -i input.mp4 -c:a copy -c:v libx265 -preset fast -x265-params crf=25 -vf scale=-8:ih output.mkv
The command works as expected on other files, but this particular file throws:
[matroska @ 0x88c2e0] Error parsing AAC extradata, unable to determine samplerate.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Source info from mediainfo:
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 138 MiB
Duration : 25mn 31s
Overall bit rate mode : Variable
Overall bit rate : 755 Kbps
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=50
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 25mn 31s
Duration_FirstFrame : 40ms
Bit rate : 650 Kbps
Width : 864 pixels
Original width : 854 pixels
Height : 470 pixels
Original height : 480 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.064
Stream size : 118 MiB (86%)
Writing library : x264 core 148 r236 a01e339
Encoding settings : cabac=1 / ref=1 / deblock=1:-1:-1 / analyse=0x1:0x111 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-1 / threads=2 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=50 / keyint_min=5 / scenecut=0 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=650 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=850 / vbv_bufsize=850 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Codec ID : 40
Duration : 25mn 31s
Bit rate mode : Variable
Bit rate : 98.5 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Frame rate : 43.066 fps (1024 spf)
Compression mode : Lossy
Stream size : 18.0 MiB (13%)
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
I've tested playback of the source file which works as expected on both totem and mplayer. Based on the error I can only surmise that there's something off with the AAC stream description data. (extradata). My goal is to somehow repair/normalize this data so that I can successfully transcode it with HEVC encoder v.1.9