How to make high quality MPEG4 video
Sugiura Shiro
sugiura at kt.rim.or.jp
Mon Sep 15 00:55:58 PDT 2003
In article <20030908203315.3d575666.steve at sohara.org>
steve at sohara.org writes:
>> SS> ---------------------------------------------------------------------
>> SS> ----(1)% ffmpeg -r 29.97 -s 640x480 -ac 2 -ar 48000 -ab 256 -acodec
>> SS> mp3 -vcodec \
>> SS> mpegvideo -b 8000 -tvstd ntsc tv.mpg
>> SS>
>> SS> PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU
>> SS> COMMAND 648 sugiura 8 0 11912K 10256K nanslp 0:52 49.88%
>> SS> 49.61% ffmpeg
>> SS>
>> SS> (2)% ffmpeg -s 640x480 -tvstd ntsc -vcodec mpeg4 -b 2000 -acodec mp3
>> SS> -ac 2 \
>> SS> -ab 256 -r 29.97 -f avi TV.avi
>> SS>
>> SS> PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU
>> SS> COMMAND 657 sugiura 100 0 13092K 11588K RUN 1:47 36.77%
>> SS> 36.77% ffmpeg
>>
>> A little odd, I'd expect mpeg4 production to be slightly more
>> CPU intensive than mpeg1 - but these figures look reasonable. Presumably
>> these did not work well in some way - what happened ?
I tried to some test, then user time MPEG1 > MPEG4 ,but systime MPEG4 > MPEG1
on Pentium4 without HTT and SMP.
--TEST.csh--------------------------------------------------------------
#!/bin/csh
setenv BKTR_FORMAT 2
@ LOOPS=10
@ SEC=800
set ffmpeg="ffmpeg -y -t $SEC -r 29.97 -s 640x480 -ac 2 -ar 48000 -tvstd ntsc -hq "
set mpeg1_=" -ab 256 -acodec mp3 -vcodec mpegvideo -b 8000 tv.mpg"
set mpeg4_=" -ab 256 -acodec mp3 -vcodec mpeg4 -b 2000 -f avi tv4.avi"
set msmpeg4_=" -ab 128 -acodec ac3 -vcodec msmpeg4v2 -b 2000 -f avi tv4m2.avi"
set raw_=" -acodec pcm_s16le -vcodec rawvideo tvR.avi"
@ count=1
while ( $count <= $LOOPS )
echo "Loop $count"
echo -n "MPEG1 :"
time $ffmpeg $mpeg1_ > /dev/null |& grep \+
echo -n "MPEG4 :"
time $ffmpeg $mpeg4_ > /dev/null |& grep \+
echo -n "MSMPEG4 :"
time $ffmpeg $msmpeg4_ > /dev/null |& grep \+
echo -n "RAW :"
time $ffmpeg $raw_ > /dev/null |& grep \+
@ count+=1
end
---------------------------------------------------------------------
--Results---------------------------------------------------------------
Loop 1
MPEG1 :494.212u 6.614s 13:20.75 62.5% 56+8139k 22+6362io 190pf+0w
MPEG4 :385.428u 12.376s 13:20.92 49.6% 56+10110k 17+1743io 176pf+0w
MSMPEG4 :373.991u 8.665s 13:20.56 47.7% 56+9279k 8+1644io 152pf+0w
RAW :119.448u 50.564s 13:20.47 21.2% 56+5935k 355+85809io 150pf+0w
Loop 2
MPEG1 :487.825u 7.218s 13:21.20 61.7% 56+8125k 66+6360io 176pf+0w
MPEG4 :406.480u 12.605s 13:21.01 52.3% 56+10126k 25+1742io 176pf+0w
MSMPEG4 :355.670u 9.256s 13:20.75 45.5% 56+9275k 16+1644io 151pf+0w
RAW :118.934u 51.168s 13:25.63 21.1% 56+5898k 990+85807io 150pf+0w
Loop 3
MPEG1 :455.539u 7.041s 13:21.13 57.7% 56+8132k 62+6361io 176pf+0w
MPEG4 :392.309u 12.393s 13:21.08 50.5% 56+10119k 23+1740io 176pf+0w
MSMPEG4 :373.658u 9.217s 13:20.62 47.8% 56+9272k 15+1643io 150pf+0w
RAW :120.200u 50.345s 13:25.48 21.1% 56+5898k 998+85807io 150pf+0w
Loop 4
MPEG1 :477.891u 7.458s 13:21.25 60.5% 56+8137k 62+6361io 176pf+0w
MPEG4 :410.977u 13.160s 13:21.07 52.9% 56+10109k 22+1742io 176pf+0w
MSMPEG4 :381.468u 9.091s 13:20.83 48.7% 56+9296k 15+1644io 150pf+0w
RAW :119.426u 51.020s 13:25.62 21.1% 56+5904k 993+85807io 150pf+0w
Loop 5
MPEG1 :476.624u 8.010s 13:21.28 60.4% 56+8145k 61+6361io 176pf+0w
MPEG4 :407.733u 12.631s 13:21.24 52.4% 56+10130k 22+1742io 176pf+0w
MSMPEG4 :381.648u 8.828s 13:20.67 48.7% 56+9286k 15+1643io 150pf+0w
RAW :119.766u 50.492s 13:25.30 21.1% 56+5897k 988+85807io 150pf+0w
Loop 6
MPEG1 :490.418u 7.214s 13:21.42 62.0% 56+8139k 61+6361io 176pf+0w
MPEG4 :396.721u 12.576s 13:21.13 51.0% 56+10122k 22+1742io 176pf+0w
MSMPEG4 :417.065u 8.955s 13:20.71 53.2% 56+9284k 15+1642io 150pf+0w
RAW :119.962u 50.447s 13:25.48 21.1% 56+5908k 994+85808io 150pf+0w
Loop 7
MPEG1 :503.389u 7.319s 13:21.20 63.7% 56+8128k 61+6360io 176pf+0w
MPEG4 :441.007u 13.582s 13:21.10 56.7% 56+10144k 22+1742io 176pf+0w
MSMPEG4 :373.070u 9.213s 13:20.67 47.7% 56+9288k 15+1644io 150pf+0w
RAW :118.173u 53.084s 13:25.53 21.2% 56+5892k 987+85808io 150pf+0w
Loop 8
MPEG1 :454.000u 7.860s 13:21.27 57.6% 56+8127k 62+6361io 176pf+0w
MPEG4 :394.710u 13.166s 13:21.07 50.9% 56+10108k 24+1739io 176pf+0w
MSMPEG4 :371.748u 8.892s 13:20.73 47.5% 56+9281k 15+1643io 150pf+0w
RAW :119.029u 51.089s 13:25.64 21.1% 56+5918k 995+85808io 150pf+0w
Loop 9
MPEG1 :449.361u 7.543s 13:21.22 57.0% 56+8139k 61+6360io 176pf+0w
MPEG4 :397.485u 13.112s 13:21.09 51.2% 56+10121k 22+1742io 176pf+0w
MSMPEG4 :381.736u 8.936s 13:20.65 48.7% 56+9289k 15+1642io 150pf+0w
RAW :117.297u 54.883s 13:25.50 21.3% 56+5900k 993+85807io 150pf+0w
Loop 10
MPEG1 :453.395u 7.503s 13:21.56 57.4% 56+8148k 61+6361io 176pf+0w
MPEG4 :363.526u 12.031s 13:20.99 46.8% 56+10102k 22+1742io 176pf+0w
MSMPEG4 :334.223u 8.878s 13:20.75 42.8% 56+9275k 15+1642io 150pf+0w
RAW :119.729u 50.759s 13:25.84 21.1% 56+5897k 1000+85807io 150pf+0w
------------------------------------------------------------------------
>> SS> (3)% ffmpeg -r 29.97 -s 640x480 -ac 2 -ar 48000 -acodec pcm_s16le
>> SS> -vcodec \ rawvideo -tvstd ntsc TV.avi
>> SS>
>> SS> PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU
>> SS> COMMAND 685 sugiura 8 0 10064K 7216K nanslp 0:12 13.83%
>> SS> 13.62% ffmpeg
>> SS> ---------------------------------------------------------------------
>> SS> ----
>> SS>
>> SS> I recorded TV like (3) , then I want to encode to MPEG4 using ffmpeg.
>> SS> But, I can't encode like following;
>> SS>
>> SS> ---------------------------------------------------------------------
>> SS> ----% ffmpeg -t 30 -r 29.97 -s 640x480 -ac 2 -ar 48000 -acodec
>> SS> pcm_s16le \
>> SS> -vcodec rawvideo -tvstd ntsc TV.avi
>>
>> The only difference is the -t 30 right ?
Yes.
>> Timer problems ??? Try kern.timecounter.method=1 in /etc/sysctl.conf
>> and a reboot to check.
It seems that there is no kern.timecounter.method parameter in 5.1-CURRENT
(20030812 and 20030914) and I cound not set it.
% sysctl -a | grep kern.timecounter
kern.timecounter.nbinuptime: 1762375
kern.timecounter.nnanouptime: 3
kern.timecounter.nmicrouptime: 4556
kern.timecounter.nbintime: 523017
kern.timecounter.nnanotime: 52
kern.timecounter.nmicrotime: 522965
kern.timecounter.ngetbinuptime: 0
kern.timecounter.ngetnanouptime: 6176
kern.timecounter.ngetmicrouptime: 425784
kern.timecounter.ngetbintime: 0
kern.timecounter.ngetnanotime: 0
kern.timecounter.ngetmicrotime: 476627
kern.timecounter.nsetclock: 3
kern.timecounter.hardware: ACPI-fast
kern.timecounter.choice: TSC(800) ACPI-fast(1000) i8254(0) dummy(-1000000)
kern.timecounter.tick: 1
--
Sugiura Shiro E-mail : sugiura at kt.rim.or.jp
More information about the freebsd-multimedia
mailing list