Results 1 to 10 of 19

Thread: avconv mov to flv

Hybrid View

  1. #1
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    673
    Distro
    Ubuntu 14.04 Trusty Tahr

    avconv mov to flv

    Hi Guys,

    I've been using ffmpeg to convert both .avi and .mov files to .flv files which I put on a website. (These are just home movies.)

    Today I noticed a blurb fly by after I entered the alias from my .Bash_aliases file into the terminal. The blurb said that I should use avconv, so I thought I'd give it a shot.

    Well I can convert .mp4 files just fine using:
    Code:
    avconv -i foo.mp4 -s 320x240 -ar 22050 bar.flv
    but if I use:
    Code:
    avconv -i foo.mov -s 320x240 -ar 22050 bar.flv
    with .mov files shot on an iPhone, the resulting flash video is elongated.

    so I tried
    Code:
    avconv -i foo.mov -ar 22050 bar.flv
    and the resulting flash video is jerky.

    Does anyone have any recommendations?

    I appreciate the help.
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

  2. #2
    Join Date
    Dec 2006
    Beans
    6,934

    Re: avconv mov to flv

    Can you post the full command and terminal output from the command that does not resize the video? As an aside I should mention that there would not be any problem using FFmpeg itself particularly if you used a modern version of it:

    Compile FFmpeg on Ubuntu
    https://ffmpeg.org/trac/ffmpeg/wiki/...mpilationGuide

    Highly recommended if you are a serious video converter...
    You think that's air you're breathing now?

  3. #3
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    673
    Distro
    Ubuntu 14.04 Trusty Tahr

    Question Re: avconv mov to flv

    I tried again going from a .mov file from the iPhone to Flash. Below is the command and terminal output:

    Code:
    $ avconv -i foo.mov -s 320x240 -ar 22050 bar.flv
    avconv version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
      built on Nov  6 2012 16:50:25 with gcc 4.6.3
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'foo.mov':
      Metadata:
        major_brand     : qt  
        minor_version   : 0
        compatible_brands: qt  
        creation_time   : 2012-12-31 13:19:43
      Duration: 00:00:38.80, start: 0.000000, bitrate: 5341 kb/s
        Stream #0.0(und): Video: h264 (Baseline), yuv420p, 960x540, 5235 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc
        Metadata:
          creation_time   : 2012-12-31 13:19:43
        Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 110 kb/s
        Metadata:
          creation_time   : 2012-12-31 13:19:43
    [buffer @ 0x8ed9160] w:960 h:540 pixfmt:yuv420p
    [scale @ 0x8ed5ee0] w:960 h:540 fmt:yuv420p -> w:320 h:240 fmt:yuv420p flags:0x4
    Output #0, flv, to 'bar.flv':
      Metadata:
        major_brand     : qt  
        minor_version   : 0
        compatible_brands: qt  
        creation_time   : 2012-12-31 13:19:43
        encoder         : Lavf53.21.0
        Stream #0.0(und): Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 1k tbn, 30 tbc
        Metadata:
          creation_time   : 2012-12-31 13:19:43
        Stream #0.1(und): Audio: libmp3lame, 22050 Hz, stereo, s16, 200 kb/s
        Metadata:
          creation_time   : 2012-12-31 13:19:43
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 -> flv)
      Stream #0:1 -> #0:1 (aac -> libmp3lame)
    Press ctrl-c to stop encoding
    frame= 1162 fps= 80 q=3.9 Lsize=    1910kB time=38.73 bitrate= 403.9kbits/s    
    video:1109kB audio:759kB global headers:0kB muxing overhead 2.238796%
    In the second test I removed the dimensions from the command.
    Code:
    $ avconv -i foo.mov -ar 22050 bar.flv
    avconv version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
      built on Nov  6 2012 16:50:25 with gcc 4.6.3
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'foo.mov':
      Metadata:
        major_brand     : qt  
        minor_version   : 0
        compatible_brands: qt  
        creation_time   : 2012-12-31 13:19:43
      Duration: 00:00:38.80, start: 0.000000, bitrate: 5341 kb/s
        Stream #0.0(und): Video: h264 (Baseline), yuv420p, 960x540, 5235 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc
        Metadata:
          creation_time   : 2012-12-31 13:19:43
        Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 110 kb/s
        Metadata:
          creation_time   : 2012-12-31 13:19:43
    [buffer @ 0x9789160] w:960 h:540 pixfmt:yuv420p
    Output #0, flv, to 'bar.flv':
      Metadata:
        major_brand     : qt  
        minor_version   : 0
        compatible_brands: qt  
        creation_time   : 2012-12-31 13:19:43
        encoder         : Lavf53.21.0
        Stream #0.0(und): Video: flv, yuv420p, 960x540, q=2-31, 200 kb/s, 1k tbn, 30 tbc
        Metadata:
          creation_time   : 2012-12-31 13:19:43
        Stream #0.1(und): Audio: libmp3lame, 22050 Hz, stereo, s16, 200 kb/s
        Metadata:
          creation_time   : 2012-12-31 13:19:43
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 -> flv)
      Stream #0:1 -> #0:1 (aac -> libmp3lame)
    Press ctrl-c to stop encoding
    frame= 1162 fps= 57 q=31.0 Lsize=    5584kB time=38.73 bitrate=1181.0kbits/s    
    video:4783kB audio:759kB global headers:0kB muxing overhead 0.754517%
    Today in my short 38 second video test. The second Flash video doesn't seem jerky, so I guess it is OK.

    I'm curious why you would recommend FFmpeg over avconv? I'm not really a "serious" video converter, I'm not ripping DVDs. I am taking video from an iPhone and another digital camera and putting it on the web. The video is of our kids and I post them so both sets of Grandparents can view them.

    So, why not just use YouTube, you ask? Well, it seems that the Grandparents in Japan have had a really big problem with YouTube lagging and they say it's easier to view if I put the videos on my site. I've tried a few different formats and the flv that I'm using seems to load the quickest and has OK quality.

    I'm just flying by the seat of my pants here, so any advice from someone who actually knows what they are doing would be much appreciated.
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

  4. #4
    Join Date
    Dec 2006
    Beans
    6,934

    Re: avconv mov to flv

    There are much more skilled FFmpeg users on these Forums than myself but perhaps I can make a few observations:

    Firstly I note that your original file contains h264 video and aac audio both of which actually live quite comfortably in a flv container. When you accept the FFmpeg/avconv defaults you actually get flv video and mp3 sound in an flv container, not a great problem but just be aware that you could probably just transfer the existing codecs to a new container. I see from your post that you have already experimented a little with this and other containers.

    If your copy of avconv has access to the video filter scale perhaps try something like:

    Code:
    avconv -i foo.mov \
           -c:v flv -q:v 5 -vf scale=320:-1 \
           -c:a libmp3lame -q:a 3 \
           bar.flv
    and add any necessary embellishments to the commandline as required. This may be enough to get decent quality sound and video and certainly the syntax I have suggested with the scale filter should resize things nicely. (The -1 for height resizes as appropriate to maintain the aspect ratio.) Experiment a little with the video -q:v 5 setting until you are happy, a setting of 1 will be very high quality while a setting of 21 would be very low quality.

    As for suggesting FFmpeg there are several reasons:

    • A lot of the expert help on these Forums, and I do not include myself in this in this group of experts, comes from people using FFmpeg rather than avconv, including the maintainer of the guide I mentioned.
    • It is better to use a cutting edge copy of FFmpeg/avconv rather than the repository offering and there is only an FFmpeg guide for this purpose.
    • You and I would then be using the same version of FFmpeg and there would be no discrepance in terms of syntax, fiters etc.
    • When the big fork occurred I fell down on the FFmpeg side


    Let me know how you go with this, hopefully this will make the grandparents happy
    Last edited by andrew.46; January 1st, 2013 at 12:29 AM. Reason: Removed some unnecessary comments, apologies to all...
    You think that's air you're breathing now?

  5. #5
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    673
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: avconv mov to flv

    Quote Originally Posted by andrew.46 View Post

    As for suggesting FFmpeg there are several reasons:

    • A lot of the expert help on these Forums, and I do not include myself in this in this group of experts, comes from people using FFmpeg rather than avconv, including the maintainer of the guide I mentioned.
    • It is better to use a cutting edge copy of FFmpeg/avconv rather than the repository offering and there is only an FFmpeg guide for this purpose.
    • You and I would then be using the same version of FFmpeg and there would be no discrepance in terms of syntax, fiters etc.
    • When the big fork occurred I fell down on the FFmpeg side


    Let me know how you go with this, hopefully this will make the grandparents happy
    Alrighty then, those reasons make sense to me. Plus the guide is so well setup that even a hobbiest like myself can follow the steps to compile and install the dev version of ffmpeg.

    So if I want to go from .mov to .flv at 320x240 with audio at 22050. What would the command be?

    Also on another note, some of our video comes from a camera that shoots mpg files. I've been combining all the mpg files into one using the cat command.
    Code:
    cat video1.mpg video2.mpg > output.mpg
    I've noticed that in Movie Player the output.mpg only plays as far as the fisrt video in the sequence. In VLC, however, the entire output video will play, but it only displays time for the length of the first segment - thereafter the video continues to play as it should except the time has stopped moving forward.

    Is this normal?
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

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

    Re: avconv mov to flv

    Quote Originally Posted by GrouchyGaijin View Post
    So if I want to go from .mov to .flv at 320x240 with audio at 22050. What would the command be?
    Just add that into the audio line:

    Code:
    -c:a libmp3lame -q:a 3 -ar 22050
    Bear in mind that you only specify the width of the output image, avconv decides on the height while maintaining the aspect ratio.


    Also on another note, some of our video comes from a camera that shoots mpg files. I've been combining all the mpg files into one using the cat command.
    Code:
    cat video1.mpg video2.mpg > output.mpg
    I've noticed that in Movie Player the output.mpg only plays as far as the fisrt video in the sequence. In VLC, however, the entire output video will play, but it only displays time for the length of the first segment - thereafter the video continues to play as it should except the time has stopped moving forward.

    Is this normal?
    I have not had much to do with concatenating videos although it sounds from your example that there are some pitfalls . Have a look here for some guidance:

    3.14 How can I concatenate video files?
    http://ffmpeg.mplayerhq.hu/faq.html#...deo-files_003f

    I like the look of the new concat demuxer. Sorry I cannot be much help on this one...
    You think that's air you're breathing now?

  7. #7
    Join Date
    Dec 2005
    Location
    U.S.A.
    Beans
    200
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: avconv mov to flv

    Why not simply get a Dropbox or other cloud account, upload your mov files, send grandparents an email with attachments. They can download and watch mov files with vlc.

  8. #8
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    673
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: avconv mov to flv

    Quote Originally Posted by JimS View Post
    Why not simply get a Dropbox or other cloud account, upload your mov files, send grandparents an email with attachments. They can download and watch mov files with vlc.
    Is this a real suggestion or are you making a joke?
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

  9. #9
    Join Date
    Dec 2005
    Location
    U.S.A.
    Beans
    200
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: avconv mov to flv

    Joodan ja nai!
    I've done it my way after reducing my camera images with ffmpeg.
    And then I sent them to relatives via email attachments from Dropbox.
    It works and it is free. Quality isn't the best.
    I'm not running a webserver, so I can't help you there. Good luck.
    MVH
    JimS
    ...

  10. #10
    Join Date
    Feb 2009
    Beans
    98
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: avconv mov to flv

    Quote Originally Posted by GrouchyGaijin View Post
    Is this a real suggestion or are you making a joke?
    It was a simple but great suggestion. Why not?
    Overclocked HPML150 running Precise Pangolin 12.04 LTS

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
  •