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

Thread: Code required to convert mp4 to ogv

  1. #1
    Join Date
    Feb 2008
    Location
    Munster, Ireland
    Beans
    2,289
    Distro
    Xubuntu

    Code required to convert mp4 to ogv

    Hi,
    I need to convert mp4 to ogv using mencoder or ffmpeg.
    I tried oggconvert but it did not work for this particular mp4 file.
    Thanks.
    1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
    GNU/Linux User #470660 – Ubuntu User #28226
    Isaac Asimov: "I do not fear computers. I fear the lack of them."

  2. #2
    Join Date
    Sep 2006
    Beans
    3,490

    Re: Code required to convert mp4 to ogv

    Generally, "ffmpeg input ouput.ogg" will work, but by default, for some unknown reason, ffmpeg will use FLAC instead of vorbis for audio with OGG container, so vorbis must be specified:
    Code:
    ffmpeg -i kideatsdirt.mp4 -acodec vorbis -vcodec libtheora kideatsdirt.ogv

  3. #3
    Join Date
    Feb 2008
    Location
    Munster, Ireland
    Beans
    2,289
    Distro
    Xubuntu

    Re: Code required to convert mp4 to ogv

    Quote Originally Posted by FakeOutdoorsman View Post
    Generally, "ffmpeg input ouput.ogg" will work, but by default, for some unknown reason, ffmpeg will use FLAC instead of vorbis for audio with OGG container, so vorbis must be specified:
    Code:
    ffmpeg -i kideatsdirt.mp4 -acodec vorbis -vcodec libtheora kideatsdirt.ogv
    Output:

    Code:
    :~/Desktop$ ffmpeg -i a.mp4 -acodec vorbis -vcodec libtheora a.ogv
    FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
      configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec --disable-vis --enable-shared --disable-static
      libavutil version: 49.6.0
      libavcodec version: 51.50.0
      libavformat version: 52.7.0
      libavdevice version: 52.0.0
      built on Oct  3 2008 22:40:31, gcc: 4.3.2
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a.mp4':
      Duration: 00:21:35.1, start: 0.000000, bitrate: 492 kb/s
        Stream #0.0(und): Video: h264, yuv420p, 352x264 [PAR 0:1 DAR 0:1], 25.00 tb(r)
        Stream #0.1(und): Audio: mp3, 22050 Hz, stereo, 128 kb/s
    Unable to find a suitable output format for 'a.ogv'
    1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
    GNU/Linux User #470660 – Ubuntu User #28226
    Isaac Asimov: "I do not fear computers. I fear the lack of them."

  4. #4
    Join Date
    Sep 2006
    Beans
    3,490

    Re: Code required to convert mp4 to ogv

    Curse these multiple ffmpeg versions! Try this:
    Code:
    ffmpeg -i a.mp4 -acodec vorbis -vcodec libtheora -f ogg a.ogv
    Your version seems like it doesn't know what ogv is, so it has to be told with "-f ogg". This code will use the default bitrate of 200k, so you may want to increase that with "-b 512k" or whatever. Same for audio, default is 64k, so change it with "-ab 128k".
    Last edited by FakeOutdoorsman; November 12th, 2008 at 10:23 PM.

  5. #5
    Join Date
    Feb 2008
    Location
    Munster, Ireland
    Beans
    2,289
    Distro
    Xubuntu

    Re: Code required to convert mp4 to ogv

    Hi,
    I tried
    Code:
    ffmpeg -i a.mp4 -acodec vorbis -vcodec libtheora -f ogg a.ogv
    but no luck.

    Then I tried
    Code:
    ffmpeg -i a.mp4 -b 1024k -acodec vorbis -vcodec libtheora -f ogg a.ogv
    Both methods recorded the full length and the sound was perfect. However the video was garbled.

    What I did in the end was converted the file using Media Coder in Windows and then converted the file from avi to ogv using OGGConvert in Ubuntu.
    Done.

    Edit: Granted, I could have converted the mp4 file to an avi file in Ubuntu. It would still be preferable to have a method to do it in Mencoder or FFmpeg though.
    Last edited by Rytron; November 25th, 2008 at 07:10 PM.
    1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
    GNU/Linux User #470660 – Ubuntu User #28226
    Isaac Asimov: "I do not fear computers. I fear the lack of them."

  6. #6
    Join Date
    Jun 2009
    Beans
    17
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Code required to convert mp4 to ogv

    Using WIndows is no solution for me. Anybody got an update on that?

    Need to convert ogv to mpeg or mp4. VLC won't work. Avidemux doesn't recognize ogv files.

    i'm stuck.

  7. #7
    Join Date
    Aug 2009
    Beans
    824

    Re: Code required to convert mp4 to ogv

    Using WIndows is no solution for me.
    You can try VLC to re-encode but it doesn't do a good job. Probably need to re-encode the result with Avidemux

  8. #8
    Join Date
    Feb 2008
    Location
    Munster, Ireland
    Beans
    2,289
    Distro
    Xubuntu

    Re: Code required to convert mp4 to ogv

    Quote Originally Posted by Rodnox View Post
    Using WIndows is no solution for me. Anybody got an update on that?

    Need to convert ogv to mpeg or mp4. VLC won't work. Avidemux doesn't recognize ogv files.

    i'm stuck.
    Try devede.
    1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
    GNU/Linux User #470660 – Ubuntu User #28226
    Isaac Asimov: "I do not fear computers. I fear the lack of them."

  9. #9
    Join Date
    Dec 2005
    Beans
    733
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Code required to convert mp4 to ogv

    what does ffmpeg -formats | grep ogg display?
    I can convert to ogv easily with ffmpeg but i am using the latest svn build r21651

  10. #10
    Join Date
    Jul 2008
    Location
    Birmingham, England
    Beans
    2,400

    Re: Code required to convert mp4 to ogv

    Quote Originally Posted by cor2y View Post
    what does ffmpeg -formats | grep ogg display?
    I can convert to ogv easily with ffmpeg but i am using the latest svn build r21651
    r21658 is the latest revision but I get your point

    The below worked fine but surely x264 is a better encoder?

    Code:
    ffmpeg -i /mnt/Videos/Music\ Videos/When\ The\ Tigers\ Broke\ Free\ \(Video\).mov -vcodec libtheora -acodec libvorbis -ab 128k -b 350k ~/Tigers.ogv

Page 1 of 2 12 LastLast

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
  •