This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你好,
在如下dm365的demo encode的实例的结构体中有如下定义:
/* Environment passed when creating the thread */ |
而在另一个地方,将其设置为:
if (args->videoStd == VideoStd_D1_PAL) { |
理解:videoFrameRate 应该是视频帧率,一般是25、30、60。
疑问1:此处是帧率么?
疑问2:如果是,为什么要乘以1000?
疑问3:如果是,为什么只支持30fps?不知道60fps?是驱动库不支持么?
你好;
feller shi 说:疑问1:此处是帧率么?
这是是设置编码帧率,你这个是在video.c 文件中的代码吧
feller shi 说:疑问2:如果是,为什么要乘以1000?
这里你可以参考参数的定义
XDAS_Int32 refFrameRate; /**< Reference or input frame rate * 1000. */
XDAS_Int32 targetFrameRate; /**< Target frame rate * 1000. */
feller shi 说:疑问3:如果是,为什么只支持30fps?不知道60fps?是驱动库不支持么?
这个应当针对你采集的平台,应当采集D1的视频,也就是pal 或ntsc ,经过去隔行处理后,就是25或30 帧了
1.这是dvsdk4.02 dm365的demo中main.c的代码。
2.前几个清楚了。最后一个问题还是有些疑问:
(1)因为判断分支只判断是否PAL,是的话25000,否的话30000
(2)我们的单板,设计是要支持60fps的。
(3)demo的默认参数是720p60fps
(4)所以,感觉这里这个二选一分支,是否将帧率给设置死了么?
代码比较多,我就全部贴出来了。
(5)或者,如果我要移植一个encode、一个decode,两个是独立的,参考哪个代码示例比较好一些?:)
谢谢
Int main(Int argc, Char *argv[]) /* Zero out the thread environments */ /* Parse the arguments given to the app and set the app environment */ printf("Encode demo started.\n"); /* Launch interface app */ /* Initialize the mutex which protects the global data */ /* Set the priority of this whole process to max (requires root) */ /* Initialize Codec Engine runtime */ /* Initialize Davinci Multimedia Application Interface */ initMask |= LOGSINITIALIZED; /* Create the user interface */ hUI = UI_create(&uiAttrs); if (hUI == NULL) { /* Get configuration from QT interface if necessary */ /* Validate arguments */ if (hPauseProcess == NULL) { /* Determine the number of threads needing synchronization */ if (args.videoFile) { if (args.audioFile || args.speechFile) { if (hRendezvousCapStd == NULL || hRendezvousInit == NULL || /* Initialize the thread attributes */ /* Force the thread to use custom scheduling attributes */ /* Set the thread to be fifo real time scheduled */ /* Create the video threads if a file name is supplied */ if (captureEnv.hInFifo == NULL || captureEnv.hOutFifo == NULL) { /* Create the capture thread */ if (pthread_create(&captureThread, NULL, captureThrFxn, &captureEnv)) { initMask |= CAPTURETHREADCREATED; /* /* Create the writer fifos */ if (writerEnv.hInFifo == NULL || writerEnv.hOutFifo == NULL) { /* Set the video thread priority */ /* Create the video thread */ if (pthread_create(&videoThread, &attr, videoThrFxn, &videoEnv)) { initMask |= VIDEOTHREADCREATED; /* /* Create the writer thread */ if (pthread_create(&writerThread, NULL, writerThrFxn, &writerEnv)) { initMask |= WRITERTHREADCREATED; } /* Create the audio thread */ initMask |= AUDIOTHREADCREATED;
/* Create the speech thread */ if (pthread_create(&speechThread, &attr, speechThrFxn, &speechEnv)) { initMask |= SPEECHTHREADCREATED; /* Main thread becomes the control thread */ ret = ctrlThrFxn(&ctrlEnv); if (ret == THREAD_FAILURE) { cleanup: /* Make sure the other threads aren't waiting for init to complete */ /* Wait until the other threads terminate */ if (initMask & AUDIOTHREADCREATED) { if (initMask & WRITERTHREADCREATED) { if (writerEnv.hOutFifo) { if (writerEnv.hInFifo) { if (initMask & CAPTURETHREADCREATED) { if (captureEnv.hOutFifo) { if (captureEnv.hInFifo) { if (hRendezvousCleanup) { if (hRendezvousInit) { if (hPauseProcess) { if (hUI) { /*
exit(status); |
你好;
这个25帧或者是30帧是针对D1信号的,如果是720P,可以设置为60;
if (args->videoStd == VideoStd_D1_PAL)
{
videoEnv.videoFrameRate = 25000;
} else {
videoEnv.videoFrameRate = 30000;
}