视频的输出模式以及音视频不同步问题

环境:TI   DVR RDK DM810X

 

输出模式:

音视频不同步以及视频的输出制式问题


采用NTSC输出,每秒30帧,每帧的时间是33ms

采用PAL输出,每秒25帧,每帧的时间40ms


也可以通过命令行查看模式  HDMI 对应 display0PAL对应 display2


查看 前运行两个脚本  ./init.sh  ./load.sh 否则找不到对应的设备

 cat /sys/device/platform/vpss/display0/mode

cat/sys/device/platform/vpss/display2/mode


若修改先关闭使能->修改->开启(手册中)

echo0 > /sys/devices/platform/vpss/display0/enable

echopal > /sys/devices/platform/vpss/display0/enable

echo1 > /sys/devices/platform/vpss/display0/enable

这种方法失效,系统不保存参数。开机后直接按照程序的设计设置

输出分辨率设置 demo_vdec_vdis.c

   vdisParams.deviceParams[VDIS_DEV_HDMI].resolution   = DEMO_HD_DISPLAY_DEFAULT_STD;// VSYS_STD_1080P_50

    /* Since HDCOMP and DVO2 are tied togetherthey must have same resolution */

   vdisParams.deviceParams[VDIS_DEV_HDCOMP].resolution =DEMO_HD_DISPLAY_DEFAULT_STD;

   vdisParams.deviceParams[VDIS_DEV_DVO2].resolution   =

                          vdisParams.deviceParams[VDIS_DEV_HDMI].resolution;

   vdisParams.deviceParams[VDIS_DEV_SD].resolution     = VSYS_STD_PAL;//

 

音视频不同步,修改输出模式,相应每一帧的时间也需要改变。

demo_vdec_vdis_bits_rd.c

#defineVDEC_VDIS_FRAME_DURATION_MS (40)   //33


实现视频的快放与慢放可以通过gVdecVdis_config.frameCnt[pEmptyBuf->chnId]来控制



int _tmain(int argc, _TCHAR* argv[]) { currentAudioClock = 0; currentVideoClock = 0; currentBufferClock = 0; //currentPlayClock=0; CurrentVolume = SDL_MIX_MAXVOLUME; if (SDL_Init(SDL_INIT_EVERYTHING) != 0) { fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError()); return 1; } SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE); SDL_EventState(SDL_USEREVENT, SDL_IGNORE); atexit(SDL_Quit);// 注册SDL_Quit,当退出时调用,使得退出时程序自动清理 //flag=2; //给音视频队列分配空间 videoQueue = (VideoQueue *)av_mallocz(sizeof(VideoQueue)); audioQueue = (AudioQueue *)av_mallocz(sizeof(AudioQueue)); //初始化音视频队列 VideoQueueInit(videoQueue); AudioQueueInit(audioQueue); char* url = "G:/上海滩.mp4"; //char* url = "G:/2014年5月26日17 12 00至2014年5月26日17 14 59.avi"; //char* url = "H:/视频/不当交易.The.Unjust.BD.MiniSD-TLF.mkv"; //char* url = "E:/BaiduMusic/Songs/Love Story - Taylor Swift.mp3"; decodeTid = SDL_CreateThread(DecodePacket, "DecodePacket", (void*)url); PlayVideoTid = SDL_CreateThread(PlayVideo, "PlayVideo", NULL); PlayAudioTid = SDL_CreateThread(PlayAudio, "PlayAudioTid", NULL); int tid; SDL_WaitThread(decodeTid, &tid); printf("decodeTid %d\n", tid); SDL_WaitThread(PlayVideoTid, &tid); printf("PlayVideoTid %d\n", tid); SDL_WaitThread(PlayAudioTid, &tid); printf("PlayAudioTid %d\n", tid); SDL_DestroyMutex(audioQueue->audioMutex); SDL_DestroyCond(audioQueue->audioCond); SDL_DestroyMutex(videoQueue->videoMutex); SDL_DestroyCond(videoQueue->videoCond); av_free(videoQueue); av_free(audioQueue); return 0; }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

为了维护世界和平_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值