How to make high quality MPEG4 video

Sugiura Shiro sugiura at kt.rim.or.jp
Sun Sep 7 08:28:59 PDT 2003


In article <20030902183709.7534858c.steve at sohara.org>
steve at sohara.org writes:

>> SS> I tried to direct encode a sportscast like following:
>> SS> 
>> SS> % ffmpeg -s 640x480 -tvstd ntsc -vcodec mpeg4 -b 2000 -acodec mp3 -ac
>> SS> 2 \
>> SS>   -ab 128 -f avi TV.avi
>> SS> 
>> SS> It uses about 30% CPU on average.
>> 
>> 	That seems too low. What version of FreeBSD are you running ?
>> There was an update merged to stable on 17 June this year that fixed a
>> nasty problem with the bktr sync signalling at full resolution YUV.

I use 5.1-CURRENT-20030812.
I tried to turned off HTT on BIOS, and rebuild kernel without SMP ,
then it likes so better. 

-------------------------------------------------------------------------
(1)% ffmpeg -r 29.97 -s 640x480 -ac 2 -ar 48000 -ab 256 -acodec mp3 -vcodec \
 mpegvideo -b 8000 -tvstd ntsc tv.mpg

  PID USERNAME PRI NICE   SIZE    RES STATE    TIME   WCPU    CPU COMMAND
  648 sugiura    8    0 11912K 10256K nanslp   0:52 49.88% 49.61% ffmpeg
 
(2)% ffmpeg -s 640x480 -tvstd ntsc -vcodec mpeg4 -b 2000 -acodec mp3 -ac 2 \
  -ab 256 -r 29.97 -f avi TV.avi

  PID USERNAME PRI NICE   SIZE    RES STATE    TIME   WCPU    CPU COMMAND
  657 sugiura  100    0 13092K 11588K RUN      1:47 36.77% 36.77% ffmpeg

(3)% ffmpeg -r 29.97 -s 640x480 -ac 2 -ar 48000 -acodec pcm_s16le -vcodec \
rawvideo -tvstd ntsc TV.avi

  PID USERNAME PRI NICE   SIZE    RES STATE    TIME   WCPU    CPU COMMAND
  685 sugiura    8    0 10064K  7216K nanslp   0:12 13.83% 13.62% ffmpeg
-------------------------------------------------------------------------

I recorded TV like (3) , then I want to encode to MPEG4 using ffmpeg.
But, I can't encode like following;

-------------------------------------------------------------------------
% ffmpeg -t 30 -r 29.97 -s 640x480 -ac 2 -ar 48000 -acodec pcm_s16le \
 -vcodec rawvideo -tvstd ntsc TV.avi

% ls -al TV.avi
-rw-r--r--  1 sugiura  users  420572266 Sep  8 00:15 TV.avi

% ffmpeg -i TV.avi -b 2000 -vcodec mpeg4 -acodec mp3 -ac 2 -ab 128 TV2.avi
Input #0, avi, from 'TV.avi':
  Duration: 00:00:30.0, bitrate: 112040 kb/s
  Stream #0.0: Video: rawvideo, yuv420p, 640x480, 29.97 fps
  Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
Output #0, avi, to 'TV2.avi':
  Stream #0.0: Video: mpeg4, 640x480, 29.97 fps, q=2-31, 2000 kb/s
  Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame=    3 q=2.0 size=     776kB time=0.1 bitrate=63493.3kbits/s
----------------------------------^^^^^^^^-------------------------------

Only 0.1 sec "time" ????

-------------------------------------------------------------------------
% ls -al TV2.avi                                                     
-rw-r--r--  1 ssugiura  users  814516 Sep  8 00:15 TV2.avi
-------------------------------------------------------------------------

TV2.avi file is too small, and I can't playback TV2.avi with mplayer.

Is there any options to encode MPEG4?

--  
Sugiura Shiro      E-mail : sugiura at kt.rim.or.jp


More information about the freebsd-multimedia mailing list