LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 09-23-2011, 11:55 AM   #1
hydraMax
Member
 
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:

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

Code:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Android-20110922-VIDEO0015.mp4':
  Metadata:
    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
    Metadata:
      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, 12:16 PM   #2
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

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

Why not try vpxenc, there are some examples here:
http://www.webmproject.org/tools/enc..._command_lines

Last edited by H_TeXMeX_H; 09-23-2011 at 12:19 PM.
 
1 members found this post helpful.
Old 09-24-2011, 04:23 AM   #3
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 646

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

Code:
root@skamandros/home/andrew# find /usr/share -iname 'libvpx*'
/usr/share/ffmpeg/libvpx-720p50_60.ffpreset
/usr/share/ffmpeg/libvpx-720p.ffpreset
/usr/share/ffmpeg/libvpx-360p.ffpreset
/usr/share/ffmpeg/libvpx-1080p50_60.ffpreset
/usr/share/ffmpeg/libvpx-1080p.ffpreset
 
Old 09-24-2011, 04:52 PM   #4
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Original Poster
Rep: Reputation: 51
Quote:
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:
http://www.webmproject.org/tools/enc..._command_lines
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.
 
  


Reply


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 01:04 PM
LXer: FFmpeg 0.6 Released With H.264, VP8 Love LXer Syndicated Linux News 0 06-16-2010 10:10 AM
LXer: Google opens VP8 codec, aims to nuke H.264 with WebM LXer Syndicated Linux News 9 05-24-2010 03:54 PM
LXer: Statement on WebM and VP8 LXer Syndicated Linux News 0 05-20-2010 08:20 AM
LXer: Google Open Sources VP8 Video Codec, Packs It Into WebM Video Format - Already LXer Syndicated Linux News 0 05-19-2010 06:11 PM


All times are GMT -5. The time now is 07:13 AM.

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