I am able to transcode from
mov wmv avi
to
mp4 flv

but I cannot find working settings for 3gp - I was able to transcode 3gp to flv in the video module, but the same settings don't work for the other formats

output:

FFmpeg failed to transcode sample.3gp.
Reported errors

PHPVideoToolkit error: Execute error. It was not possible to encode "/var/www/[domain]-dev/sites/default/files/videos/original/sample.3gp" as FFmpeg returned an error. The error is with the audio codec of the input file. FFmpeg reports the error to be "Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height".
Executed commands and output

/ffmpeg -i '/var/www/[domain]-dev/sites/default/files/videos/original/sample.3gp' -vf 'crop=176:37,scale=676:438' -strict experimental -vcodec 'flv1' -qscale '12' -acodec 'aac' -ac '2'  -y /var/www/[domain]-dev/sites/default/files/tmp/1378505453-522a52eda3102.flv
ffmpeg version git-2013-08-26-8d679bc Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 25 2013 23:46:41 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
  configuration: --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --disable-ffplay --enable-shared --enable-gpl --enable-postproc --enable-version3 --enable-nonfree --enable-avfilter --enable-pthreads
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.102 / 55. 14.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.102 /  3. 82.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/[domain]-dev/sites/default/files/videos/original/sample.3gp':
  Metadata:
    major_brand     : 3gp5
    minor_version   : 256
    compatible_brands: 3gp53gp4
    creation_time   : 2005-10-28 17:36:40
  Duration: 00:00:04.93, start: 0.000000, bitrate: 46 kb/s
    Stream #0:0(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 8 kb/s (default)
    Metadata:
      creation_time   : 2005-10-28 17:36:40
      handler_name    : Apple Sound Media Handler
    Stream #0:1(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 176x144 [SAR 1:1 DAR 11:9], 35 kb/s, 15 fps, 15 tbr, 600 tbn, 1k tbc (default)
    Metadata:
      creation_time   : 2005-10-28 17:36:40
      handler_name    : Apple Video Media Handler
Please use -q:a or -q:v, -qscale is ambiguous
[aac @ 0xdb83c0] Too many bits per frame requested
Output #0, flv, to '/var/www/[domain]-dev/sites/default/files/tmp/1378505453-522a52eda3102.flv':
  Metadata:
    major_brand     : 3gp5
    minor_version   : 256
    compatible_brands: 3gp53gp4
    Stream #0:0(eng): Video: flv1 (flv), yuv420p, 676x438 [SAR 1606:507 DAR 44:9], q=2-31, 200 kb/s, 90k tbn, 15 tbc (default)
    Metadata:
      creation_time   : 2005-10-28 17:36:40
      handler_name    : Apple Video Media Handler
    Stream #0:1(eng): Audio: aac, 8000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2005-10-28 17:36:40
      handler_name    : Apple Sound Media Handler
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg4 -> flv)
  Stream #0:0 -> #0:1 (amrnb -> aac)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

also, I am able to transcode the same sample.3gp file with ffmpeg on the command line, and the transcoded test_aac.mp4 file is fine:

$ ffmpeg -i sample.3gp -acodec libfdk_aac -ar 44100 test_aac.mp4
ffmpeg version git-2013-08-26-8d679bc Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 25 2013 22:01:15 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
  configuration: --prefix=/home/decibelplaces/ffmpeg_build --extra-cflags=-I/home/decibelplaces/ffmpeg_build/include --extra-ldflags=-L/home/decibelplaces/ffmpeg_build/lib --bindir=/home/decibelplaces/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.102 / 55. 14.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.102 /  3. 82.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.3gp':
  Metadata:
    major_brand     : 3gp5
    minor_version   : 256
    compatible_brands: 3gp53gp4
    creation_time   : 2005-10-28 17:36:40
  Duration: 00:00:04.93, start: 0.000000, bitrate: 46 kb/s
    Stream #0:0(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 8 kb/s (default)
    Metadata:
      creation_time   : 2005-10-28 17:36:40
      handler_name    : Apple Sound Media Handler
    Stream #0:1(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 176x144 [SAR 1:1 DAR 11:9], 35 kb/s, 15 fps, 15 tbr, 600 tbn, 1k tbc (default)
    Metadata:
      creation_time   : 2005-10-28 17:36:40
      handler_name    : Apple Video Media Handler
File 'test_aac.mp4' already exists. Overwrite ? [y/N] y
[libx264 @ 0x2141920] using SAR=1/1
[libx264 @ 0x2141920] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
[libx264 @ 0x2141920] profile High, level 1.0
[libx264 @ 0x2141920] 264 - core 123 r2189 35cf912 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=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 chroma_qp_offset=-2 threads=12 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=15 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test_aac.mp4':
  Metadata:
    major_brand     : 3gp5
    minor_version   : 256
    compatible_brands: 3gp53gp4
    encoder         : Lavf55.14.102
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 176x144 [SAR 1:1 DAR 11:9], q=-1--1, 15360 tbn, 15 tbc (default)
    Metadata:
      creation_time   : 2005-10-28 17:36:40
      handler_name    : Apple Video Media Handler
    Stream #0:1(eng): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 44100 Hz, mono, s16, 96 kb/s (default)
    Metadata:
      creation_time   : 2005-10-28 17:36:40
      handler_name    : Apple Sound Media Handler
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg4 -> libx264)
  Stream #0:0 -> #0:1 (amrnb -> libfdk_aac)
Press [q] to stop, [?] for help
Multiple frames in a packet from stream 0
frame=   74 fps=0.0 q=-1.0 Lsize=      85kB time=00:00:05.01 bitrate= 139.2kbits/s    
video:22kB audio:59kB subtitle:0 global headers:0kB muxing overhead 4.272074%
[libx264 @ 0x2141920] frame I:2     Avg QP:12.97  size:   144
[libx264 @ 0x2141920] frame P:51    Avg QP:24.13  size:   412
[libx264 @ 0x2141920] frame B:21    Avg QP:26.58  size:    38
[libx264 @ 0x2141920] consecutive B-frames: 59.5%  8.1%  0.0% 32.4%
[libx264 @ 0x2141920] mb I  I16..4: 97.5%  1.0%  1.5%
[libx264 @ 0x2141920] mb P  I16..4:  3.1%  0.8%  0.2%  P16..4: 17.5%  4.3%  2.8%  0.0%  0.0%    skip:71.4%
[libx264 @ 0x2141920] mb B  I16..4:  1.0%  0.0%  0.1%  B16..8:  6.6%  0.4%  0.1%  direct: 0.7%  skip:91.1%  L0:30.4% L1:68.1% BI: 1.5%
[libx264 @ 0x2141920] 8x8 transform intra:9.7% inter:79.3%
[libx264 @ 0x2141920] coded y,uvDC,uvAC intra: 8.2% 11.1% 7.3% inter: 7.6% 6.0% 3.3%
[libx264 @ 0x2141920] i16 v,h,dc,p: 69% 21% 10%  0%
[libx264 @ 0x2141920] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  8% 20% 42%  5%  4%  6%  2%  4% 10%
[libx264 @ 0x2141920] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 14% 48%  2%  6%  3%  4%  4%  3%
[libx264 @ 0x2141920] i8c dc,h,v,p: 75% 17%  7%  0%
[libx264 @ 0x2141920] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x2141920] ref P L0: 75.5% 11.5%  8.9%  4.0%
[libx264 @ 0x2141920] ref B L0: 75.6% 14.2% 10.2%
[libx264 @ 0x2141920] ref B L1: 95.2%  4.8%
[libx264 @ 0x2141920] kb/s:35.82

Comments

Jorrit’s picture

The error is 'Too many bits per frame requested' for aac. You did not specify an audio bit rate, so it takes the bit rate of the input, which is 46 kb/s. This appears to be invalid for aac. So edit your preset and specify a specific audio bit rate.

decibel.places’s picture

Status: Active » Closed (works as designed)

thanks for pointing that out

from the command line I set -ar 44100

so in my presets > Advanced Audio Settings I set Audio sample rate to 44100

worked like a charm

juanmm’s picture

I had problems with this aspect of the error "width or height not divisible by 2" when trying to convert from or to 3gp or 3g2 , this is the code i used and now is working:

(in this case is specified a given height of 720 pixels ..)

scale="'trunc(720*iw/ih/2)*2):720'"

decibel.places’s picture

Issue summary: View changes