Results 1 to 9 of 9

Thread: COnvert video to 3GP fails

  1. #1
    Join Date
    Jan 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Lubuntu 14.04 Trusty Tahr

    COnvert video to 3GP fails

    I am trying to convert a flv video to 3gp with mobile media converter.

    But I am getting this error



    Code:
    >> Command executed:
    ffmpeg -y -i "/home/tux/325 litre Malawi cichlid tank - YouTube.flv"  -vf scale=352:288 -f 3gp -vcodec h263 -r 15 -b 200k -acodec libvo_aacenc -ac 2 -ar 32000 -ab 64k "/home/tux/325 litre Malawi cichlid tank - YouTube.3gp"
    
    
    >> Result: 
    ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
      built on Jan 24 2013 18:01:36 with gcc 4.6.3
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    [flv @ 0x11bd9c0] Estimating duration from bitrate, this may be inaccurate
    Input #0, flv, from '/home/tux/325 litre Malawi cichlid tank - YouTube.flv':
      Metadata:
        starttime       : 0
        totalduration   : 224
        totaldatarate   : 1262
        bytelength      : 35310013
        canseekontime   : true
        sourcedata      : B4A7DA925MM1362765817125709
        purl            : 
        pmsg            : 
      Duration: 00:03:43.80, start: 0.000000, bitrate: 1284 kb/s
        Stream #0.0: Video: h264 (Main), yuv420p, 854x478 [PAR 1:1 DAR 427:239], 1185 kb/s, 25 tbr, 1k tbn, 50 tbc
        Stream #0.1: Audio: aac, 44100 Hz, stereo, s16, 98 kb/s
    [buffer @ 0x11bd940] w:854 h:478 pixfmt:yuv420p
    [scale @ 0x11c04a0] w:854 h:478 fmt:yuv420p -> w:352 h:288 fmt:yuv420p flags:0x4
    [h263 @ 0x1415140] Invalid pixel aspect ratio 3843/2629, limit is 255/255
    Output #0, 3gp, to '/home/tux/325 litre Malawi cichlid tank - YouTube.3gp':
        Stream #0.0: Video: h263, yuv420p, 352x288 [PAR 3843:2629 DAR 427:239], q=2-31, 200 kb/s, 90k tbn, 15 tbc
        Stream #0.1: Audio: libfaac, 32000 Hz, stereo, s16, 200 kb/s
    Stream mapping:
      Stream #0.0 -> #0.0
      Stream #0.1 -> #0.1
    Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
    ----------------------------
    Lubuntu 14.04 / Manjaro (openbox)
    Some people are funny. They spend money they don't have, to buy things they don't need, to impress people they don't even like.

  2. #2
    Join Date
    Jul 2012
    Beans
    315
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: COnvert video to 3GP fails

    There seems to be something wrong with "h263". The same (similar) command run with "h264" works fine?
    (I am using the compiled version of "real" ffmpeg, dated Sep 2012)


    Member FODM to the rescue please ?
    Last edited by Merrattic; March 10th, 2013 at 06:05 PM.
    The best things in life are free, so what are we paying for?

  3. #3
    Join Date
    Dec 2006
    Beans
    6,926

    Re: COnvert video to 3GP fails

    Perhaps try -r 25 for your commandline instead of -r 15.
    You think that's air you're breathing now?

  4. #4
    Join Date
    Jul 2012
    Beans
    315
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: COnvert video to 3GP fails

    I tried with -r 15 and that works!

    Code:
    ffmpeg -i test.mp4 -c:v h263 -r 15 -b:v 200k -vf scale=352:288 -aspect 16:9 -c:a libopencore_amrnb -ac 1 -ar 8000 -b:a 12200 test.3gp
    In fact the least I could get away with to make it run was:

    Code:
    ffmpeg -i test.mp4 -vf scale=352:288 -ac 1 -ar 8000 -b:a 12200 test1.3gp
    Last edited by Merrattic; March 11th, 2013 at 01:36 AM.
    The best things in life are free, so what are we paying for?

  5. #5
    Join Date
    Jan 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: COnvert video to 3GP fails

    Code:
    ~$ ffmpeg -i malawi.flv -c:v h263 -r 15 -b:v 200k -vf scale=352:288 -aspect 16:9 -c:a libopencore_amrnb -ac 1 -ar 8000 -b:a 12200 test.3gp
    ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
      built on Jan 24 2013 18:01:36 with gcc 4.6.3
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    [flv @ 0x17089c0] Estimating duration from bitrate, this may be inaccurate
    Input #0, flv, from 'malawi.flv':
      Metadata:
        starttime       : 0
        totalduration   : 224
        totaldatarate   : 1262
        bytelength      : 35310013
        canseekontime   : true
        sourcedata      : B4A7DA925MM1362765817125709
        purl            : 
        pmsg            : 
      Duration: 00:03:43.80, start: 0.000000, bitrate: 1284 kb/s
        Stream #0.0: Video: h264 (Main), yuv420p, 854x478 [PAR 1:1 DAR 427:239], 1185 kb/s, 25 tbr, 1k tbn, 50 tbc
        Stream #0.1: Audio: aac, 44100 Hz, stereo, s16, 98 kb/s
    Unrecognized option 'c:v'
    Failed to set value 'h263' for option 'c:v'

    Code:
    ~$ ffmpeg -i malawi.flv -c:v h263 -r 25 -b:v 200k -vf scale=352:288 -aspect 16:9 -c:a libopencore_amrnb -ac 1 -ar 8000 -b:a 12200 test.3gp
    ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
      built on Jan 24 2013 18:01:36 with gcc 4.6.3
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    [flv @ 0x11e79c0] Estimating duration from bitrate, this may be inaccurate
    Input #0, flv, from 'malawi.flv':
      Metadata:
        starttime       : 0
        totalduration   : 224
        totaldatarate   : 1262
        bytelength      : 35310013
        canseekontime   : true
        sourcedata      : B4A7DA925MM1362765817125709
        purl            : 
        pmsg            : 
      Duration: 00:03:43.80, start: 0.000000, bitrate: 1284 kb/s
        Stream #0.0: Video: h264 (Main), yuv420p, 854x478 [PAR 1:1 DAR 427:239], 1185 kb/s, 25 tbr, 1k tbn, 50 tbc
        Stream #0.1: Audio: aac, 44100 Hz, stereo, s16, 98 kb/s
    Unrecognized option 'c:v'
    Failed to set value 'h263' for option 'c:v'
    Lubuntu 14.04 / Manjaro (openbox)
    Some people are funny. They spend money they don't have, to buy things they don't need, to impress people they don't even like.

  6. #6
    Join Date
    Dec 2006
    Beans
    6,926

    Re: COnvert video to 3GP fails

    You have an aged version of FFmpeg . Try using the older -acodec and -vcodec syntax...
    You think that's air you're breathing now?

  7. #7
    Join Date
    Sep 2006
    Beans
    3,484

    Re: COnvert video to 3GP fails

    This is confirmed as Yet Another Libav Bug (YALB). It will work if you use a recent real ffmpeg as shown by Merrattic. The difference is that the fake so-called ffmpeg from libav (and their current code) will just fail with the "Invalid pixel aspect ratio" message, but real ffmpeg will automatically reduce the ratio limit and continue to encoding. You can download a static build of ffmpeg. No need to install (example instructions), or you can compile ffmpeg if you like.

    We can also improve it a bit since forcing the scale will probably stretch it vertically, so you can add some padding with the pad filter.
    Code:
    ffmpeg -i input -vf "scale=352:-1,pad=iw:288:0:trunc((288-ih)/2)" -vcodec h263 -b:v 200k -acodec libvo_aacenc -ab 128k output.3gp
    The "trunc((288-ih)/2)" is just a fancy way of saying 45 since 288 (the desired height) - 197 (the value -1 in the scale filter gives you) = 91 and 91 / 2 = 45.5, so it has to be rounded up or down for the pad to work.

    Valid sizes for this encoder are 128x96, 176x144, 352x288, 704x576, and 1408x1152.
    Last edited by FakeOutdoorsman; March 12th, 2013 at 12:23 AM. Reason: confirm the YALB

  8. #8
    Join Date
    Jan 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: COnvert video to 3GP fails

    https://launchpad.net/~jon-severinsson/+archive/ffmpeg

    I just updates ffmpeg. Now it encodes.

    And my phone can play the videos too.

    Thanks for all your replies.
    Last edited by linuxyogi; March 12th, 2013 at 05:11 AM.
    Lubuntu 14.04 / Manjaro (openbox)
    Some people are funny. They spend money they don't have, to buy things they don't need, to impress people they don't even like.

  9. #9
    Join Date
    Dec 2006
    Beans
    6,926

    Re: COnvert video to 3GP fails

    Good to hear that you have resolved the issue .
    You think that's air you're breathing now?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •