Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-23-2011, 12:55 PM   #1
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
ffmpeg: converting mp4 to webm (vp8)

Hi. I'm no expert at video transcoding, but I have this project where I am transcoding 3gp videos from my cellphone into webm files that I can embed on my Web site. I managed to extract the mpeg4 video from all the 3gp files (don't need the audio) and put them into .mp4 files using ffmpeg and a ruby script. Then I figured out that vlc has a cool "convert" menu that allows me to convert an mp4 file into a VP8/Webm file, which worked great.

However, I wanted to automate that last step in a script (I have lots of videos to convert). I know that VLC is using ffmpeg, so if I could figure out the raw ffmpeg command I would be able to create the script easily enough. But I can't. After going through the man page I thought it would be something like this:

ffmpeg -i Android-20110922-VIDEO0015.mp4 -vcodec vp8 -target webm Android-20110922-VIDEO0015.webm
But this dies with:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Android-20110922-VIDEO0015.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf52.110.0
  Duration: 00:01:11.10, start: 0.000000, bitrate: 232 kb/s
    Stream #0.0(eng): Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 229 kb/s, 40 fps, 40 tbr, 40 tbn, 40 tbc
      creation_time   : 1970-01-01 00:00:00
Could not determine norm (PAL/NTSC/NTSC-Film) for target.
Please prefix target with "pal-", "ntsc-" or "film-",
or set a framerate with "-r xxx".
If I try to prefix the target like it says (which makes no sense anyway) it does not work and if I try to set the framerate (with -r 40) it brings up the exact same error message.

Does someone know the correct syntax?
Old 09-23-2011, 01:16 PM   #2
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284
I would omit the '-target' if you can. Specify everything else if you need to.

Why not try vpxenc, there are some examples here:

Last edited by H_TeXMeX_H; 09-23-2011 at 01:19 PM.
1 members found this post helpful.
Old 09-24-2011, 05:23 AM   #3
Registered: Oct 2007
Distribution: Slackware
Posts: 705

Rep: Reputation: 109Reputation: 109
The latest FFmpeg has some libvpx presets that might be helpful:

root@skamandros/home/andrew# find /usr/share -iname 'libvpx*'
Old 09-24-2011, 05:52 PM   #4
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Original Poster
Rep: Reputation: 51
Originally Posted by H_TeXMeX_H View Post
I would omit the '-target' if you can. Specify everything else if you need to.

Why not try vpxenc, there are some examples here:
This worked, after I also omitted the -vcodec part. So in the end I just needed to tell it the name of the input file and the name of the output file, and it figured out the rest.

It's kind of funny that ffmpeg could figure out what I wanted to do based solely on filename extensions, but I couldn't figure out how to tell it what I wanted it to do using exact command line switches.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: MPEG LA begins search for WebM/VP8 patents LXer Syndicated Linux News 1 02-12-2011 02:04 PM
LXer: FFmpeg 0.6 Released With H.264, VP8 Love LXer Syndicated Linux News 0 06-16-2010 11:10 AM
LXer: Google opens VP8 codec, aims to nuke H.264 with WebM LXer Syndicated Linux News 9 05-24-2010 04:54 PM
LXer: Statement on WebM and VP8 LXer Syndicated Linux News 0 05-20-2010 09:20 AM
LXer: Google Open Sources VP8 Video Codec, Packs It Into WebM Video Format - Already LXer Syndicated Linux News 0 05-19-2010 07:11 PM

All times are GMT -5. The time now is 12:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration