Science Blog of Dr. Yuan分享 http://blog.sciencenet.cn/u/albumns This blog is mainly on Molecular molecular modelling and simulations

博文

convert multimedia between different formats

已有 3393 次阅读 2014-5-5 04:00 |个人分类:Linux相关|系统分类:科研笔记


Converting multimedia between different formats can be needed for different purposes. Although there are many tools under Windows, it is still feasible for such task under Linux OS including both command line and GUI end tool. Here are some popular methods for such purposes:

 

(1) Command ffpeg:

Hyper fast Audio and Video encoder

usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

 

Getting help:

   -h      -- print basic options

   -h long -- print more options

   -h full -- print all options (including all format and codec specific options, very long)

   See man ffmpeg for detailed description of the options.

Video options:

-vframes number     set the number of video frames to record

-r rate             set frame rate (Hz value, fraction or abbreviation)

-s size             set frame size (WxH or abbreviation)

-aspect aspect      set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)

-bits_per_raw_sample number  set the number of bits per raw sample

-vn                 disable video

-vcodec codec       force video codec ('copy' to copy stream)

-timecode hh:mm:ss[:;.]ff  set initial TimeCode value.

-pass n             select the pass number (1 to 3)

-vf filter_graph    set video filters

-b bitrate          video bitrate (please use -b:v)

-dn                 disable data

Audio options:

-aframes number     set the number of audio frames to record

-aq quality         set audio quality (codec-specific)

-ar rate            set audio sampling rate (in Hz)

-ac channels        set number of audio channels

-an                 disable audio

-acodec codec       force audio codec ('copy' to copy stream)

-vol volume         change audio volume (256=normal)

-af filter_graph    set audio filters

Subtitle options:

-s size             set frame size (WxH or abbreviation)

-sn                 disable subtitle

-scodec codec       force subtitle codec ('copy' to copy stream)

-stag fourcc/tag    force subtitle tag/fourcc

-fix_sub_duration   fix subtitles duration

-canvas_size size   set canvas size (WxH or abbreviation)

-spre preset        set the subtitle options to the indicated preset

Example:

ffmpeg -i input.mkv -f avi -vcodec mpeg4 -s 864x480 -b 800 -g 300 -bf 2 -ab 128000 -b 1200000 -mbd 2 -flags -aic 2 -cmp 2 -subcmp 2 output.mp4

 

 

(2) Command  mencoder:

Basic syntax: mencoder original_video.mpg -o new_video.avi -ovc output_video_codec -oac output_audio_codec

 

mencoder -ovc help

MEncoder 1.1-4.7 (C) 2000-2012 MPlayer Team

Available codecs:

  copy     - frame copy, without re-encoding. Doesn't work with filters.

  frameno  - special audio-only file for 3-pass encoding, see DOCS.

  raw      - uncompressed video. Use fourcc option to set format explicitly.

  nuv      - nuppel video

  lavc     - libavcodec codecs - best quality!

 

mencoder -oac help

MEncoder 1.1-4.7 (C) 2000-2012 MPlayer Team

Available codecs:

  copy     - frame copy, without re-encoding (useful for AC3)

  pcm      - uncompressed PCM audio

  mp3lame  - cbr/abr/vbr MP3 using libmp3lame

  lavc     - FFmpeg audio encoder (MP2, AC3, ...)


Example:

Combine multiple files into one:

mencoder -idx -ovc copy -o output.mp4 01.mp4 02.mp4 03.mp4 04.mp4 05.mp4 06.mp4 07.mp4 08.mp4 09.mp4 10.mp4 11.mp4 12.mp4 13.mp4 14.mp4 15.mp4 16.mp4 17.mp4 18.mp4 19.mp4 -oac mp3lame

 

Make .mkv file

mkvmerge -D audio.avi -A video.avi -o mymovie.mkv

 

Convert .avi to .mp4 file:

mencoder baby.avi -o baby.mp4 -oac copy -ovc lavc -lavcopts vcodec=mpeg1video -of mpeg

 

 

(3) winFF GUI tool

WinFF is available for many Linux distributions, languages, and Windows 95 to Windows 8.

 

WinFF is open source and cross platform written in Free Pascal and Lazarus. WinFF is published under the GNU public license v3. WinFF is published without any warranty or suitability for any purpose.

 

Written by Matthew Weatherford and Ian Stoffberg.

 

Download

http://winff.org/html_new/downloads.html  




https://blog.sciencenet.cn/blog-355217-791391.html

上一篇:Hazards Of Functional Groups
下一篇:install NVIDIA Optimus for laptop
收藏 IP: 95.143.59.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-25 03:19

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部