TI Support Team,
Using the out-of-the-box encode application, I'm having the same problem as zhifei zhang describes in his post but with a twist i.e., the sudden drop in frame rate seems to be correlated to encoding bit rate in that at low encoding bit rates e.g., 800 kbps the encode frame rate wonders around the nominal 30fps (as it should) but as I increase the encoding bit rate to 1500 kbps then to 3000 kbps (and so on) the periodic drop in frame rate becomes more pronounced. In addition, the problem is independent of the encoder used i.e., the H264, MPEG4, and MPEG2 encoders all exhibit the same problem.
I suspect that the problem is in encode application (and not in the codecs) in the way the video file is written out to the NFS as I have checked the video source, video I/O, and Ethernet link and all seem to be working just fine with no anomalies e.g., when I run the encodedecode application with the codec bypassed, all is well. Also, I did not see this problem using the same HW set-up when running from DVSDK 2.10 for the DM365 EVM.
So here are the details:
1. Target is the DM365 EVM rev E
2. EVM video in is component running a video
source that is running a 1280x720p movie
3. EVM video out is component displayed on an HDTV
4. Host computer is running Ubuntu 10.04 Linux with
the DVSDK 4.00 from a default install done by
running the install script i.e., NFS, TFTP (although
the IP address is manually assigned), etc.
5. U-Boot environment and bootargs are:
printenv
bootdelay=4
baudrate=115200
ethaddr=00:0e:99:02:cc:7a
ipaddr=10.0.1.22
nfshost=10.0.1.21
serverip=10.0.1.21
bootcmd=tftp;bootm
rootpath=/home/cimarron/DVSDK_4_00/targetfs
nfsroot=10.0.1.21:/home/cimarron/DVSDK_4_00/targetfs
bootargs=console=ttyS0,115200n8 rw mem=48M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0
davinci_capture.device_type=4 davinci_display.cont2_bufsize=6291456 vpfe_capture.cont_bufoffset=6291456 vpfe_capture.cont_bufsize=6291456
davinci_enc_mngr.ch0_output=COMPONENT davinci_enc_mngr.ch0_mode=480P-60 root=/dev/nfs nfsroot=10.0.1.21:/home/cimarron/targetfs
ip=10.0.1.22:10.0.1.21:10.0.1.1:255.255.255.0:::off
bootfile=uImage-dm365-evm.bin
stdin=serial
stdout=serial
stderr=serial
ver=U-Boot 1.3.4 (Mar 2 2009 - 11:50:39)
Here is a trace that shows the problem (of course, the video "stutters" when video frames are dropped at the offending point in time):
First we execute loadmodules.sh script:
root@dm365-evm:/usr/share/ti/dvsdk-demos# ./loadmodules.sh
cmemk unregistered
irqk unregistered
CMEMK module: built on Oct 14 2010 at 18:09:45
Reference Linux version 2.6.32
File /sdk/build/DVSDK_4_00/4_00_00_22/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_25_05_11-r44d/linuxutils_2_25_05_11/packages/ti sdo/linuxutils/cmem/src/module/cmemk.c
allocated heap buffer 0xc8000000 of size 0x43b000
CMEM Range Overlaps Kernel Physical - allowing overlap
CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83000000)
cmemk initialized
IRQK module: built on Oct 14 2010 at 18:10:06
Reference Linux version 2.6.32
File /sdk/build/DVSDK_4_00/4_00_00_22/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_25_05_11-r44d/linuxutils_2_25_05_11/packages/ti/sdo/linuxutils/irq/src/module/irqk.c
irqk initialized
EDMAK module: built on Oct 14 2010 at 18:09:56
Reference Linux version 2.6.32
File /sdk/build/DVSDK_4_00/4_00_00_22/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_25_05_11-r44d/linuxutils_2_25_05_11/packages/ti/sdo/linuxutils/edma/src/module/edmak.c
Now we execute the encode application:
root@dm365-evm:/usr/share/ti/dvsdk-demos# ./encode -v Avatar.264 -r 1280x720 -b 3000000
Encode demo started.
EVM: switch to tvp7002 HD video input
davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
davinci_previewer davinci_previewer.2: ipipe_set_preview_config
vpfe-capture vpfe-capture: IPIPE Chained
vpfe-capture vpfe-capture: Resizer present
EVM: switch to tvp7002 HD video input
vpfe-capture vpfe-capture: width = 1280, height = 720, bpp = 1
vpfe-capture vpfe-capture: adjusted width = 1280, height = 720, bpp = 1, bytesperline = 1280, sizeimage = 1382400
vpfe-capture vpfe-capture: width = 1280, height = 720, bpp = 1
vpfe-capture vpfe-capture: adjusted width = 1280, height = 720, bpp = 1, bytesperline = 1280, sizeimage = 1382400
davinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT:
layer.pix_fmt.bytesperline = 1280,
layer.pix_fmt.width = 1280,
layer.pix_fmt.height = 720,
layer.pix_fmt.sizeimage =1382400
davinci_v4l2 davinci_v4l2.1: pixfmt->width = 1280,
layer->layer_info.config.line_length= 1280
ARM Load: 24% Video fps: 31 fps Video bit rate: 4269 kbps Sound bit rate: 0 kbps Time: 00:00:01 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 9% Video fps: 29 fps Video bit rate: 2932 kbps Sound bit rate: 0 kbps Time: 00:00:02 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 11% Video fps: 30 fps Video bit rate: 3063 kbps Sound bit rate: 0 kbps Time: 00:00:03 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 12% Video fps: 30 fps Video bit rate: 3022 kbps Sound bit rate: 0 kbps Time: 00:00:04 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 11% Video fps: 30 fps Video bit rate: 3276 kbps Sound bit rate: 0 kbps Time: 00:00:06 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 11% Video fps: 30 fps Video bit rate: 2795 kbps Sound bit rate: 0 kbps Time: 00:00:07 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 13% Video fps: 30 fps Video bit rate: 2776 kbps Sound bit rate: 0 kbps Time: 00:00:08 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 11% Video fps: 30 fps Video bit rate: 3052 kbps Sound bit rate: 0 kbps Time: 00:00:09 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 12% Video fps: 30 fps Video bit rate: 3128 kbps Sound bit rate: 0 kbps Time: 00:00:10 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
...
ARM Load: 35% Video fps: 11 fps Video bit rate: 1258 kbps Sound bit rate: 0 kbps Time: 00:00:23 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 32% Video fps: 30 fps Video bit rate: 2877 kbps Sound bit rate: 0 kbps Time: 00:00:24 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 22% Video fps: 30 fps Video bit rate: 3003 kbps Sound bit rate: 0 kbps Time: 00:00:25 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 26% Video fps: 31 fps Video bit rate: 3008 kbps Sound bit rate: 0 kbps Time: 00:00:26 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 22% Video fps: 29 fps Video bit rate: 2965 kbps Sound bit rate: 0 kbps Time: 00:00:27 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 21% Video fps: 30 fps Video bit rate: 3038 kbps Sound bit rate: 0 kbps Time: 00:00:29 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
ARM Load: 21% Video fps: 30 fps Video bit rate: 3051 kbps Sound bit rate: 0 kbps Time: 00:00:30 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A
...
The sudden drop in frame rate is periodic with the frequency show in the trace above, is independent of the video program being encoded but is highly dependent on the encoding bit rate.
Any help solving this problem will be much appreciated...
--Chuck