Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2123970
  • 博文数量: 229
  • 博客积分: 7217
  • 博客等级: 上校
  • 技术积分: 3224
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-19 17:23
个人简介

个人主页https://xugaoxiang.com,微信公众号: Dev_Club 或者搜索 程序员Club

文章分类

全部博文(229)

文章存档

2017年(1)

2016年(20)

2015年(23)

2013年(1)

2012年(23)

2011年(68)

2010年(62)

2009年(31)

分类: LINUX

2010-09-19 10:40:43

It's time to show advantages for FFMPEG when your media player can not play some media with certain codecs or formats.The tutorial leads you to convert the media from m2ts to avi.

1 Install extra libs(If you need)

sudo apt-get install libxvidcore-dev libfaad-dev libfaac-dev

2 Build the ffmpeg

cd ffmpeg
./configure --enable-gpl --enable-libxvid --enable-libfaac --enable-nonfree
make
sudo make install

3 Check information of the input file

djstava@Gateway:~/ffmpeg$ ffmpeg -i ~/Videos/samsum-1080P.m2ts
FFmpeg version SVN-r25137, Copyright (c) 2000-2010 the FFmpeg developers
  built on Sep 19 2010 10:50:36 with gcc 4.4.3
  configuration: --enable-gpl --enable-libxvid --enable-libfaac --enable-nonfree
  libavutil     50.27. 0 / 50.27. 0
  libavcore      0. 9. 0 /  0. 9. 0
  libavcodec    52.89. 0 / 52.89. 0
  libavformat   52.78. 5 / 52.78. 5
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.39. 0 /  1.39. 0
  libswscale     0.11. 0 /  0.11. 0
Input #0, mpegts, from '/home/djstava/Videos/samsum-1080P.m2ts':
  Duration: 00:00:29.80, start: 599.958300, bitrate: 14510 kb/s
  Program 1
    Stream #0.0[0x1011](eng): Video: h264, yuv420p, 1920x1080, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0.1[0x1100](eng): Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
At least one output file must be specified

  • video bitrate = 14510 kb/s
  • video codec = h264
  • audio bitrate = 256 kb/s
  • audio codec = ac3
4 convert from m2ts to avi

ffmpeg -i /home/djstava/Videos/samsum-1080P.m2ts -vcodec mpeg4 -acodec ac3 -ac 2 -ab 256k -deinterlace -s 1920x1080 output.avi

video codec:change h264 to mpeg4
audio codec:the same


5 Check information of the output file

djstava@Gateway:~/ffmpeg$ ffmpeg -i djstava.avi
FFmpeg version SVN-r25137, Copyright (c) 2000-2010 the FFmpeg developers
  built on Sep 19 2010 10:50:36 with gcc 4.4.3
  configuration: --enable-gpl --enable-libxvid --enable-libfaac --enable-nonfree
  libavutil     50.27. 0 / 50.27. 0
  libavcore      0. 9. 0 /  0. 9. 0
  libavcodec    52.89. 0 / 52.89. 0
  libavformat   52.78. 5 / 52.78. 5
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.39. 0 /  1.39. 0
  libswscale     0.11. 0 /  0.11. 0

Seems stream 0 codec frame rate differs from container frame rate: 24000.00 (24000/1) -> 23.98 (24000/1001)
Input #0, avi, from 'djstava.avi':
  Metadata:
    ISFT            : Lavf52.78.5
  Duration: 00:00:17.72, start: 0.000000, bitrate: 2136 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 23.98 tbn, 24k tbc
    Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
At least one output file must be specified



djstava
阅读(2902) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~