James Crook, web geek ++

Video conversion: ogv to mp4

31 Aug 2011

HandBrake software screenshot

I sometimes record screencasts for clients (or just for fun) using recordmydesktop, a great, simple screen-and-voice recorder on Ubuntu.

It captures the screen and audio for a selected area and outputs it to an .ogv file. This file views fine on my own computer, but Windows users and others often have trouble with it, and it's also quite a large file size by default.

So I often convert my screencasts to .mp4 format and then put them on screencast.com. Screencast.com is great in that it lets me send private links to clients, even password-protected if I want, and it doesn't resize or reformat the videos that I put up. Screencast.com suggests using the mp4 format and with html5 handling getting better it seems good to me too.

Mencoder

I've always been a fan of mencoder for converting video. I used to convert the recordmydesktop .ogv files to .avi files using this script:

nice mencoder inputfile.ogv -ovc xvid -vf harddup -xvidencopts bitrate=800 -oac mp3lame -lameopts abr:br=92 -channels 1 -o outputfile.avi

or, using a negative bitrate creates an output file of that size using whatever bitrate is needed:

nice mencoder inputfile.ogv -ovc xvid -oac mp3lame -lameopts abr:br=92 -xvidencopts bitrate=-5000 -vf harddup -o outputfile.avi

I would put these scripts into a shell file and then run them as needed from the command line.

However, recently mencoder has had problems for me. It's dropping duplicate video frames even when I don't want it to, which causes the audio to get badly out of sync. It also doesn't seem to handle mp4 output formats well.

So I've been looking around for an alternative.

Handbrake

Handbrake is an Open Source, GUI video transcoder that runs on Windows, Mac and Linux.

It can rip DVDs (not copy-protected ones) and convert them to a variety of formats including mp4, and works with many other input video types including .ogv - so recordmydesktop screencasts are (theoretically) easy to handle.

To get it on Ubuntu you'll need to add the PPA.

However, while the interface looks nice and easy I found that for me the mp4 files created by Handbrake only contained a single still image, not moving video, although the audio played fine. I'm not sure if this is due to drivers on my system or a glitch in Handbrake, but it was enough to stop me using it.

Ffmpeg

Ffmpeg is another command-line tool.

To get ffmpeg to output successful mp4 files I had to build it following an excellent tutorial on ubuntuforums.org rather than use the default one available through the repositories.

Once I installed ffmpeg according to that tute I could use the following shell script to get a beautiful mp4 output file:

#!/bin/bash
# ogv to mp4

# 1-pass CRF encoding using ffmpeg
# Adjust -crf to change the quality. Lower numbers mean higher quality and a larger output file size. A sane range is 18 to 28.

ffmpeg -i "$1" -acodec libfaac -aq 80 -vcodec libx264 -preset slow -crf 25 -threads 0 "tmp-$2"

# qt-faststart makes playback work better on the web
qt-faststart "tmp-$2" "$2"
rm "tmp-$2"

If you copy and paste that into 'ogv2mp4.sh' you can run it with ./bin/ogv2mp4.sh inputfile.ogv outputfile.mp4

As a bonus this seems about 4x faster than the original mencoder solution. Nice.

Categories: 

Comments

31 Oct 2011

thanx for info, but there is a nice tool for video to mp4 format converting http://www.macvide.com/Macvide_iPod_Converter/, i usually use and enjoy it!)

29 Nov 2013

Video Converter is regarded to be the fastest and most reliable mkv to mp4 converter around with its superior and unique systems conversion would only take a few minutes. <a href="http://magnoconag.com/">asus laptops india price</a>

22 Jun 2014

Hi there friends, how is the whole thing, and what you wish for to say about this piece of writing, in my view its truly amazing
designed for me.

26 Jun 2014

If some one wants to be updated with latest technologies afterward he must be visit this site and be up to date
every day.

25 Aug 2014

At this time it looks like Expression Engine is the best blogging platform out there right now.
(from what I've read) Is that what you're using on your blog?

02 Aug 2014

If some one wants expert view concerning blogging and site-building after that
i suggest him/her to pay a visit this webpage, Keep up the fastidious work.

30 Jun 2014

Definitely believe that that you stated. Your favorite justification appeared to be
at the internet the simplest thing to consider of.

I say to you, I certainly get irked whilst other people think about issues that they plainly do not recognise about.

You managed to hit the nail upon the top and outlined out the entire thing
without having side effect , people can take a signal.
Will likely be again to get more. Thanks

20 Aug 2014

We're a gaggle of volunteers and starting a brand new
scheme in our community. Your website offered us with valuable information to work
on. You have done an impressive process and our entire group will probably be grateful to
you.

31 Aug 2014

Hello everyone, it's my first pay a quick visit at this web page, and piece
of writing is actually fruitful for me, keep up posting these content.

23 Aug 2014

It's health giving properties are undisputed, detox max but
without any tension. Oxycontin Withdrawal Symjptomsare an overview
of what they are not backed up and shining, and ven more gullible.
It is the shell of a body detox detox max and relaxation. Post-acute
alcohol withdrawal symptoms when their doing a simple suggest but
think about gettingg the best cleanser for toxins so
it can beto try to improve health. My message tto detox mmax release toxins.

16 Dec 2011

That's perfect! Resolved all my issues with ogv from Desktop Recorder.

15 Apr 2012

Great help that ffmpeg script! I was having massive dropped frames when mixing *.ogv (produced from screen recording with recordMyDesktop) on OpenShot video editor.
Now I convert the *.ogv to *.mp4 and the mixing goes on flawlessly.
Thanks once again!

25 Jul 2014

39Q[0-9]218

25 Jul 2014

Can I just say what a relief to discover someone who actually knows what they
are talking about on the internet. You certainly realize how to bring an issue to light
and make it important. More and more people need to read this and understand this side of the story.

It's surprising you are not more popular since you certainly have the
gift.

13 Aug 2014

Your method of telling the whole thing in this article is genuinely fastidious, all be able to simply understand it,
Thanks a lot.

29 Jul 2014

Hello to every body, it's my first go to see of this blog;
this webpage includes remarkable and genuinely fine material in support
of readers.

02 Aug 2014

Good day! This is kind of off topic but I need some guidance from an established blog.
Is it very hard to set up your own blog? I'm not very techincal but I can figure
things out pretty quick. I'm thinking about creating
my own but I'm not sure where to begin. Do you have any points or suggestions?
Thanks

15 Mar 2013

The above ffmpeg script is a little hard and complicated to me. I often type OGV Converter- Easily Convert OGV to AVI,MP4,WMV,MPEG,and FLV in Google to find the answer. If you want to get a quick solution, hope this can be helpful:
http://www.bigasoft.com/articles/ogv-converter-convert-ogv-to-avi-mp4-wm...

23 Jul 2014

Thanks for sharing your info. I really appreciate your efforts and I
will be waiting for your further write ups thanks once again.

17 Aug 2014

We are a bunch of volunteers and opening a brand new scheme in our community.
Your website provided us with helpful information to work on. You have done an impressive task
and our whole group shall be thankful to you.

23 Aug 2014

Hi, constantly i used to check website posts here in the early hours in the daylight,
because i like to gain knowledge of more and more.

17 Aug 2013

<script> alert(owned)</script>

17 Jul 2014

Bloxwich found American buyers were willing to
follow Warren Buffet's sage advice or suggestion regarding management
of your home country or, at most universities that is not an issue that's really important to your business.
Start changing your life. This success apart, there's a problem if your
short messages to people.

01 Aug 2014

Thanks in support of sharing such a fastidious opinion, post is pleasant,
thats why i have read it completely

06 Oct 2013

Super cool and interesting post! You really got my brain goin on that one! I'm going to share it with all my friends in this particular chat room site I like to go to. The site is cool if you're wondering. It's super duper fun and cool just like your magnificient post. http://adult4sexchat.com

08 Aug 2014

Good day! This post could not be written any better!
Reading through this post reminds me of my previous room
mate! He always kept talking abouut this. I will forward thos write-up tto him.
Pretty sure he will have a ood read. Thank you for sharing!

18 Apr 2014

I think ffmpeg to most people is just like Greek to them. Personally recommend a more easy-to-use and reliable way here: http://faasoft.com/articles/ogv-converter.html

16 Jul 2014

Thanks for finally writing about >Add new comment | JmsCrk <Liked it!

25 Jul 2014

I'm pretty pleased to uncover this great site. I wanted to thank you for your time just for this wonderful read!!
I definitely really liked every bit of it and i also have you saved as a favorite to look at new stuff on your website.

11 Jul 2014

Really a good article for know the real factors about video conversion.

22 Jul 2014

It's in reality a great and useful piece of information. I'm
glaad that yoou simply shared thhis useful ingormation wwith us.

Please stay us informed like this. Thank you for sharing.

19 Aug 2014

A generic drug is the combination of basic medicines or salts which comes without any labeling from a particular company.
Unfortunately, a lot of beginning users who have no enough knowledge
about Windows attempt to spare svchost themselves and as a result they come to collapse.

The difference between the generic and branded is only the price because they both work the same.
The quality as well as the safety of the generic version is equivalent to branded Cialis, the difference
lies in the cost.

16 Aug 2014

I've been exploring for a little bit for any high-quality articles or blog posts in this sort of space .
Exploring in Yahoo I ultimately stumbled upon this website.
Reading this info So i am happy to convey that I've a very just right uncanny feeling I came upon exactly what I needed.
I most no doubt will make sure to do not forget this site
and give it a glance regularly.

11 Jul 2014

Really a good article for know the real factors about video conversion.

22 Jul 2014

A fascinating discussion is worth comment.
I do think that you should write more on this
topic, it might not be a taboo matter but typically folks don't talk about
these subjects. To the next! Kind regards!!

28 Jul 2014

The children from foreign orphanages often times had worse deprivation than children in their native country.
For birth parents who have a child they wish to find a
loving home for you have the choice of your involvement during the process.

Closely linked to this strategy is the technology strategy.

31 Jul 2014

All exchanges during the crash will be rolled back, meaning
it is like they never happened, and the Bitcoin will magically be worth $17.
This is a valid premise, because this system is, after all, a system of gambling,
and people are attracted to easy ways to win money
while gambling, and in a keystroke lottery a single
consensus-validated keystroke makes you eligible to win the pot.

When the transaction is incorporated into the blockchain, the protocol awards that fee to the miners who created those particular coins.
You may be tempted to think that a task and calendar management program such as Mozilla Sunbird will
be enough, but there are so many things that we have to
do that we do not create a task for that still take up a significant amount of our daily
life.

30 Jul 2014

I almost never write responses, but after reading some of the responses here Add new comment |
JmsCrk. I actually do have a few questions for you if you do not mind.

Could it be simply me or do a few of the remarks appear like they are written by brain dead individuals?
:-P And, if you are writing on additional online sites,
I would like to keep up with you. Could you list of every one of your social sites like your linkedin profile,
Facebook page or twitter feed?

11 Jul 2014

Really a good article for know the real factors about video conversion.

24 Jul 2014

Great beat ! I wish to apprentice while you amend your site, how
can i subscribe for a weblog site? The account helped me a acceptable
deal. I have been tiny bit acquainted of this your broadcast provided shiny clear concept

17 Jul 2014

I have used handbrake, it is a good software, but the shortage is the output format only have mp4, mkv. I love Firecoresoft Video Converter too.

18 Jul 2014

Wonderful website. A lot of helpful info here. I am sending
it to some pals ans also sharing in delicious.
And certainly, thanks in your sweat!

31 Jul 2014

We're a group of volunteers and opening a brand new scheme in our community.
Your web site offered us with helpful information to work on. You have performed a
formidable job and our entire community will likely be grateful to you.

23 Aug 2014

Thanks for the marvelous posting! I certainly enjoyed
reading it, you can be a great author. I will be sure to bookmark your bblog and will come back later
in life. I want to encourage one to continue your great work, have a nice weekend!

17 Jul 2014

I have used handbrake, it is a good software, but the shortage is the output format only have mp4, mkv. I love Firecoresoft Video Converter too.

17 Jul 2014

I have used handbrake, it is a good software, but the shortage is the output format only have mp4, mkv. I love Firecoresoft Video Converter too.

17 Jul 2014

I know this if off topic but I'm looking into starting my own weblog and was wondering what all is
required to get setup? I'm assuming having a blog like
yours would cost a pretty penny? I'm not very web savvy so I'm not
100% sure. Any recommendations or advice would be
greatly appreciated. Appreciate it

27 Jul 2014

Good day! I just wish to offer you a big thumbs up for your great info you've got right
here on this post. I am returning to your blog for more soon.

07 Aug 2014

Today, I went to the beach front with my children. I found a sea shell and gave it to my 4 year old
daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and screamed.
There was a hermit crab inside and it pinched her ear. She never wants to go back!
LoL I know this is entirely off topic but I had to tell someone!

17 Jul 2014

I have used handbrake, it is a good software, but the shortage is the output format only have mp4, mkv. I love Firecoresoft Video Converter too.

Pages

Add new comment