Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: convert mp4 to avi same quality ffmpeg?

  1. #1
    Join Date
    Oct 2008
    Location
    /usr/bin/
    Beans
    484
    Distro
    Ubuntu

    convert mp4 to avi same quality ffmpeg?

    How can I convert an mp4 video to an avi with the same quality, same bitrate, same codec, same audio quality, same screen resolution with ffmpeg from the command line?

    I tried to convert a 100mb mp4 file with the following command

    ffmpeg -i in.mp4 out.avi and the result is an avi file of 30mb so obviously the quality has degraded?

  2. #2
    Join Date
    Dec 2006
    Beans
    7,310

    Re: convert mp4 to avi same quality ffmpeg?

    Depends what is in your mp4 . Can you show the full terminal output from just:

    Code:
    ffmpeg -i in.mp4
    Any special reason for the avi container?
    You think that's air you're breathing now?

  3. #3
    Join Date
    Oct 2008
    Location
    /usr/bin/
    Beans
    484
    Distro
    Ubuntu

    Re: convert mp4 to avi same quality ffmpeg?

    Quote Originally Posted by andrew.46 View Post
    Depends what is in your mp4 . Can you show the full terminal output from just:

    Code:
    ffmpeg -i in.mp4
    Any special reason for the avi container?
    no reason really but I would like to convert the mp4 to avi with same bit rate and all the rest the same

    ffmpeg -i in.mp4
    Code:
    FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers                                  
      built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)                            
      configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab                                                                                                                         
      libavutil     50.15. 1 / 50.15. 1                                                                                         
      libavcodec    52.72. 2 / 52.72. 2                                                                                         
      libavformat   52.64. 2 / 52.64. 2                                                                                         
      libavdevice   52. 2. 0 / 52. 2. 0                                                                                         
      libavfilter    1.19. 0 /  1.19. 0                                                                                         
      libswscale     0.11. 0 /  0.11. 0                                                                                         
      libpostproc   51. 2. 0 / 51. 2. 0                                                                                         
    [aac @ 0x26a62d0]Transition from an ONLY_LONG or LONG_STOP to an EIGHT_SHORT sequence detected. If you heard an audible artifact, please submit the sample to the FFmpeg developers.                                                                    
        Last message repeated 1 times
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x269d670]max_analyze_duration reached
    
    Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 29.97 (30000/1001)
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 1
        compatible_brands: mp42isom
      Duration: 00:03:56.80, start: 0.000000, bitrate: 3931 kb/s
        Stream #0.0(eng): Video: mpeg4, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 3798 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc
        Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 127 kb/s
        Stream #0.2(eng): Data: mp4s / 0x7334706D, 4320 kb/s
        Stream #0.3(eng): Data: mp4s / 0x7334706D, 3840 kb/s

  4. #4
    Join Date
    Dec 2006
    Beans
    7,310

    Re: convert mp4 to avi same quality ffmpeg?

    I am not sure that aac sound lives well in avi container but perhaps you could simply try:
    Code:
    ffmpeg -i in.mp4 -acodec copy -vcodec copy out.avi
    I am guessing the syntax a little here as your copy of FFmpeg is a little old . If playback barfs on this one try converting the sound to mp3 and this will work with avi...
    Code:
    -acodec libmp3lame
    You think that's air you're breathing now?

  5. #5
    Join Date
    Oct 2008
    Location
    /usr/bin/
    Beans
    484
    Distro
    Ubuntu

    Re: convert mp4 to avi same quality ffmpeg?

    Quote Originally Posted by andrew.46 View Post
    I am not sure that aac sound lives well in avi container but perhaps you could simply try:
    Code:
    ffmpeg -i in.mp4 -acodec copy -vcodec copy out.avi
    I am guessing the syntax a little here as your copy of FFmpeg is a little old . If playback barfs on this one try converting the sound to mp3 and this will work with avi...
    Code:
    -acodec libmp3lame
    thanks that worked

  6. #6
    Join Date
    Dec 2006
    Beans
    7,310

    Re: convert mp4 to avi same quality ffmpeg?

    Great news . Mind you if you want to get serious about FFmpeg it would not hurt to visit this great guide sometime:

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

    This will unlock a great deal more of the FFmpeg magic...
    You think that's air you're breathing now?

  7. #7
    Join Date
    Oct 2008
    Location
    /usr/bin/
    Beans
    484
    Distro
    Ubuntu

    Re: convert mp4 to avi same quality ffmpeg?

    Quote Originally Posted by andrew.46 View Post
    Great news . Mind you if you want to get serious about FFmpeg it would not hurt to visit this great guide sometime:

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

    This will unlock a great deal more of the FFmpeg magic...
    great link

  8. #8
    Join Date
    May 2006
    Location
    Milwaukee,WI
    Beans
    6,282
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: convert mp4 to avi same quality ffmpeg?

    i wasn under the impression you could merely rename a .mp4 to .avi, is that not true? after all, it's merely a container and nothing more.

  9. #9
    Join Date
    Dec 2006
    Beans
    7,310

    Re: convert mp4 to avi same quality ffmpeg?

    Quote Originally Posted by dannyboy79 View Post
    i wasn under the impression you could merely rename a .mp4 to .avi, is that not true? after all, it's merely a container and nothing more.
    I would be surprised, I believe remuxing is necessary. But I have been wrong many times before
    You think that's air you're breathing now?

  10. #10
    Join Date
    Oct 2010
    Location
    London
    Beans
    481
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: convert mp4 to avi same quality ffmpeg?

    There are differences between container formats, more than just the name: where and how metadata is stored in the file is the most significant one.

    I know from experience that some FLV files are close enough to MP4 that renaming them was enough to get my PS3 to play them; but many are not. The same may be true with AVI files, I suppose it would depend on how exactly they were encoded and what decoder (player) you're using. It will always be safer to just remux the files into a new container, and even on my atom-based netbook that doesn't take very long.

Page 1 of 2 12 LastLast

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
  •