Skip to main content
added a suggestion request to make it lossless
Source Link

Also any suggestion to make it lossless

Also any suggestion to make it lossless

Source Link

FFmpeg : Error occurred while encoding audio stream from ac3 to aac

I am using following command to encode my video to h264 and aac audio codec :

ffmpeg -i sample.mp4 -codec:v libx264 -profile:v high -level:v 4.0 -codec:a libvo_aacenc -b:a 128k output_file.mp4

Following is a trace of the error i am getting at the console.

Input #0, mpegts, from 'sample.mp4':
  Duration: 00:00:58.08, start: 1.000033, bitrate: 17290 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1
080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fl
tp, 448 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
[libx264 @ 003dc660] using SAR=1/1
[libx264 @ 003dc660] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 003dc660] profile High, level 4.0
[libx264 @ 003dc660] 264 - core 130 r2274 c832fe9 - H.264/MPEG-4 AVC codec - Cop
yright 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 de
block=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1
me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chr
oma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1
 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=
1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scen
ecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmi
n=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libvo_aacenc @ 03c3c640] Unable to set encoding parameters
Output #0, mp4, to 'output_file.mp4':
    Stream #0:0: Video: h264, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 90
k tbn, 29.97 tbc
    Stream #0:1: Audio: aac, 48000 Hz, 5.1(side), s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (ac3 -> libvo_aacenc)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters
such as bit_rate, rate, width or height

I am really not able to find what possibly could be wrong. I dont want to copy audio codec , i wish to encode it from ac3 to aac