linux之x86裁剪移植---ffmpeg的H264解码显示(420、422)

简介: <p>在虚拟机上yuv420可以正常显示 ,而945(D525)模块上却无法显示 ,后来验证了directdraw的yuv420也无法显示 ,由此怀疑显卡不支持 ,后把420转换为422显示。</p><p>420显示如下:</p><p></p><pre code_snippet_id="1682097" snippet_file_name="blog_20160513_1_4130927

在虚拟机上yuv420可以正常显示 ,而945(D525)模块上却无法显示 ,后来验证了directdraw的yuv420也无法显示 ,由此怀疑显卡不支持 ,后把420转换为422显示。

420显示如下:

/*
编译命令:arm-linux-gcc -o show2642 264showyuv2.c -I/usr/local/ffmpeg_arm/include/   -L/usr/local/ffmpeg_arm/lib/ -lswresample -lavformat -lavutil -lavcodec -lswscale -lx264   libSDL.a

gcc -o test test.c -I/usr/local/ffmpeg/include/   -L/usr/local/ffmpeg/lib/ -lswresample -lavformat -lavutil -lavcodec -lswscale  -lx264 -lSDL 

*/
#include "stdio.h"
#include "stdlib.h"


#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswresample/swresample.h"
#include "libavutil/opt.h"
#include "libavutil/channel_layout.h"
#include "libavutil/parseutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/fifo.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/timestamp.h"
#include "libavutil/bprint.h"
#include "libavutil/time.h"
#include "libavutil/threadmessage.h"
#include "SDL/SDL.h"

//#include "libavfilter/avcodec.h"
#include "libavcodec/avcodec.h"

#if HAVE_SYS_RESOURCE_H
#include <sys/time.h>
#include <sys/types.h>
#include <sys/resource.h>
#elif HAVE_GETPROCESSTIMES
#include <windows.h>
#endif
#if HAVE_GETPROCESSMEMORYINFO
#include <windows.h>
#include <psapi.h>
#endif

#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

#if HAVE_TERMIOS_H
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <termios.h>
#elif HAVE_KBHIT
#include <conio.h>
#endif

#if HAVE_PTHREADS
#include <pthread.h>
#endif

#include <time.h>

#include "libavutil/avassert.h"

#define MAX_LEN  1024 * 50

////此方法参考官网的例子
static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize,
                     FILE *f)
{
  //  FILE *f;
    int i;
   // f = fopen(filename,"w");
   // fprintf(f, "P5\n%d %d\n%d\n", xsize, ysize, 255);
    for (i = 0; i < ysize; i++)
     ;//   fwrite(buf + i * wrap, 1, xsize, f);
  //  fclose(f);
}


int main()
{
	//下面初始化h264解码库
	//avcodec_init();
        int w = 720;
        int h = 576,retu;
        SDL_Rect rect;
	av_register_all();

	AVFrame *pFrame_ = NULL;

	/* find the video encoder */
	AVCodec *videoCodec = avcodec_find_decoder(AV_CODEC_ID_H264);//得到264的解码器类
	if(!videoCodec)
	{
		printf("avcodec_find_decoder error\n");
		return -1;
	}

	AVCodecParserContext *avParserContext = av_parser_init(AV_CODEC_ID_H264);//得到解析帧类,主要用于后面的帧头查找
	if(!avParserContext)
	{
		printf("av_parser_init  error\n");
		return -1;
	}
	AVCodecContext *codec_ = avcodec_alloc_context3(videoCodec);//解码会话层
	if(!codec_)
	{
		printf("avcodec_alloc_context3  error\n");
		return -1;
	}


	//初始化参数,下面的参数应该由具体的业务决定
	codec_->time_base.num = 1;
	codec_->frame_number = 1; //每包一个视频帧
	codec_->codec_type = AVMEDIA_TYPE_VIDEO;
	codec_->bit_rate = 0;
	codec_->time_base.den = 25;//帧率
	codec_->width = 720;//视频宽
	codec_->height = 576;//视频高

	if(avcodec_open2(codec_, videoCodec, NULL) >= 0)//打开解码器
	{
		pFrame_ = av_frame_alloc();// Allocate video frame    成功打开解码器后, 此时可以分配帧内存, 当然你也可以在后面每次都分配、释放, 在此我省功夫, 只在开始分配一次
		if (!pFrame_) {
			fprintf(stderr, "Could not allocate video frame\n");
			exit(1);
		}
	}
	else
	{
		printf("avcodec_open2 error\n");
		return -1;
	}

	AVPacket packet = {0};
	int dwBufsize = 10;
	int frameFinished = dwBufsize;//这个是随便填入数字,没什么作用

	av_init_packet(&packet);
	packet.data = NULL;//这里填入一个指向完整H264数据帧的指针
	packet.size = 0;//这个填入H264数据帧的大小

	FILE *myH264 = fopen("1.264", "rb");//解码的文件264
	if(myH264 == NULL)
	{
		perror("cant open 264 file\n");
		return -1;
	}

	FILE *yuvfile = fopen("my264.yuv", "wb");//成功解码后保存成的YUV文件, 可以用YUV工具打开浏览
	if(yuvfile == NULL)
	{
		perror("cant open YUV file\n");
		return -1;
	}

	int readFileLen = 1;
	char readBuf[MAX_LEN];
	unsigned char *parseBuf = malloc(20*MAX_LEN);//这个地方浪费了我一个下午时间, 当时我用的是栈内存,即unsigned char parseBuf[20*MAX_LEN], 结果运行程序一直报错, 此处需要用堆内存才能正常解码
	int  parseBufLen = 0;

	int frameCount = 0;
	printf("begin...\n");
	printf("readBuf address  is %x\n", readBuf);
/////////////////////////SDL init////////////////////////////////////////
    SDL_Surface* hello = NULL;
    SDL_Surface* screen = NULL;

    //Start SDL
   // SDL_Init( SDL_INIT_EVERYTHING );
      SDL_Init(SDL_INIT_VIDEO);

    //Set up screen
    screen = SDL_SetVideoMode( 1024, 768, 32, SDL_SWSURFACE );
    SDL_Overlay* overlay = SDL_CreateYUVOverlay(w, h, SDL_YV12_OVERLAY, screen);

    
    SDL_LockSurface(screen);
    SDL_LockYUVOverlay(overlay);
//////////////////////////////////////////////////////////////////////
	while(readFileLen > 0)//开始解码工作
	{
		//printf("begin...\n");
		readFileLen = fread(readBuf, 1, sizeof(readBuf), myH264);//首先从文件里读出数据
		if(readFileLen <= 0)
		{
			printf("read over\n");
			break;
		}
		else
		{
			int handleLen = 0;
			int handleFileLen = readFileLen;
			while(handleFileLen > 0)
			{
				int nLength = av_parser_parse2(avParserContext, codec_, &parseBuf, &parseBufLen, readBuf + handleLen, handleFileLen, 0, 0, 0);//查找264帧头
				
				handleFileLen -= nLength;
				handleLen += nLength;

				if(parseBufLen <= 0)//当parseBufLen大于0时,说明查找到了帧头
				{
					continue;
				}
				packet.size = parseBufLen;//将查找到的帧长度送入
				packet.data = parseBuf;//将查找到的帧内存送入
                                 if(frameCount>100)break;
				//printf("parseBuf address is %x\n", parseBuf);
				while(packet.size > 0)
				{//下面开始真正的解码
					int decodeLen = avcodec_decode_video2(codec_, pFrame_, &frameFinished, &packet);
					if(decodeLen < 0)
						break;
					packet.size -= decodeLen;
					packet.data += decodeLen;
					if(frameFinished > 0)//成功解码
					{
						int picSize = codec_->height * codec_->width;
						//int newSize = picSize * 1.5;

						//申请内存
						//unsigned char *buf = malloc(newSize);

						int height = pFrame_->height;
						int width = pFrame_->width;

						//printf("OK, get data\n");
						//printf("Frame height is %d\n", height);
						//printf("Frame width is %d\n", width);
						frameCount ++;
						printf("Frame count is %d\n", frameCount);
                                                

						pgm_save(pFrame_->data[0], pFrame_->linesize[0],//保存Y
                 codec_->width, codec_->height, yuvfile);
						pgm_save(pFrame_->data[1], pFrame_->linesize[1],//保存U
                 codec_->width/2, codec_->height/2, yuvfile);
						pgm_save(pFrame_->data[2], pFrame_->linesize[2],//保存V
                 codec_->width/2, codec_->height/2, yuvfile);
                        
                        ///有了YUV数据, 后面可以用FFMPEG提供的转换方法,将其转成RGB数据,进行后续的显示或其它的图像处理工作
                                            ////sdl
                                                int i;
                                                for(i=0;i<576;i++)
                                                {//fwrite(buf + i * wrap, 1, xsize, f);
                                                     memcpy(overlay->pixels[0]+i*1280, pFrame_->data[0]+i*pFrame_->linesize[0], 720);                               
                                                }
		                                for(i=0;i<288;i++)
                                                {
						     memcpy(overlay->pixels[2]+i*640, pFrame_->data[1]+i*pFrame_->linesize[1], 360);
						     memcpy(overlay->pixels[1]+i*640, pFrame_->data[2]+i*pFrame_->linesize[2], 360);                                                                      }

						SDL_UnlockYUVOverlay(overlay);
						SDL_UnlockSurface(screen);
		
						rect.w = w;
						rect.h = h;
						rect.x = rect.y = 0;
						SDL_DisplayYUVOverlay(overlay, &rect);
		                            //sdl
						SDL_Delay(40);
					}
					else
						printf("failed to decodec\n");
				}
			}
		}
	}
    //////释放工作
	avcodec_close(codec_);
	av_free(codec_);
	av_free_packet(&packet);
	av_frame_free(&pFrame_);
    //SDL
        SDL_FreeYUVOverlay(overlay);
        SDL_FreeSurface(screen);
    //Quit SDL
        SDL_Quit();
	fclose(yuvfile);
	fclose(myH264);
	
}


422显示如下:

/*
编译命令:arm-linux-gcc -o show2642 264showyuv2.c -I/usr/local/ffmpeg_arm/include/   -L/usr/local/ffmpeg_arm/lib/ -lswresample -lavformat -lavutil -lavcodec -lswscale -lx264   libSDL.a

gcc -o test test.c -I/usr/local/ffmpeg/include/   -L/usr/local/ffmpeg/lib/ -lswresample -lavformat -lavutil -lavcodec -lswscale  -lx264 -lSDL 

*/
#include "stdio.h"
#include "stdlib.h"


#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswresample/swresample.h"
#include "libavutil/opt.h"
#include "libavutil/channel_layout.h"
#include "libavutil/parseutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/fifo.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/timestamp.h"
#include "libavutil/bprint.h"
#include "libavutil/time.h"
#include "libavutil/threadmessage.h"
#include "SDL/SDL.h"

//#include "libavfilter/avcodec.h"
#include "libavcodec/avcodec.h"

#if HAVE_SYS_RESOURCE_H
#include <sys/time.h>
#include <sys/types.h>
#include <sys/resource.h>
#elif HAVE_GETPROCESSTIMES
#include <windows.h>
#endif
#if HAVE_GETPROCESSMEMORYINFO
#include <windows.h>
#include <psapi.h>
#endif

#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

#if HAVE_TERMIOS_H
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <termios.h>
#elif HAVE_KBHIT
#include <conio.h>
#endif

#if HAVE_PTHREADS
#include <pthread.h>
#endif

#include <time.h>

#include "libavutil/avassert.h"

#define MAX_LEN  1024 * 50

////此方法参考官网的例子

////此方法参考官网的例子
static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize,
                     FILE *f)
{
  //  FILE *f;
    int i;
   // f = fopen(filename,"w");
   // fprintf(f, "P5\n%d %d\n%d\n", xsize, ysize, 255);
    for (i = 0; i < ysize; i++)
       ;// fwrite(buf + i * wrap, 1, xsize, f);
  //  fclose(f);
}


int main()
{
	//下面初始化h264解码库
	//avcodec_init();
        int w = 720;
        int h = 576,retu;
        SDL_Rect rect;
	av_register_all();

	AVFrame *pFrame_ = NULL;

	/* find the video encoder */
	AVCodec *videoCodec = avcodec_find_decoder(AV_CODEC_ID_H264);//得到264的解码器类
	if(!videoCodec)
	{
		printf("avcodec_find_decoder error\n");
		return -1;
	}

	AVCodecParserContext *avParserContext = av_parser_init(AV_CODEC_ID_H264);//得到解析帧类,主要用于后面的帧头查找
	if(!avParserContext)
	{
		printf("av_parser_init  error\n");
		return -1;
	}
	AVCodecContext *codec_ = avcodec_alloc_context3(videoCodec);//解码会话层
	if(!codec_)
	{
		printf("avcodec_alloc_context3  error\n");
		return -1;
	}


	//初始化参数,下面的参数应该由具体的业务决定
	codec_->time_base.num = 1;
	codec_->frame_number = 1; //每包一个视频帧
	codec_->codec_type = AVMEDIA_TYPE_VIDEO;
	codec_->bit_rate = 0;
	codec_->time_base.den = 25;//帧率
	codec_->width = 720;//视频宽
	codec_->height = 576;//视频高

	if(avcodec_open2(codec_, videoCodec, NULL) >= 0)//打开解码器
	{
		pFrame_ = av_frame_alloc();// Allocate video frame    成功打开解码器后, 此时可以分配帧内存, 当然你也可以在后面每次都分配、释放, 在此我省功夫, 只在开始分配一次
		if (!pFrame_) {
			fprintf(stderr, "Could not allocate video frame\n");
			exit(1);
		}
	}
	else
	{
		printf("avcodec_open2 error\n");
		return -1;
	}

	AVPacket packet = {0};
	int dwBufsize = 10;
	int frameFinished = dwBufsize;//这个是随便填入数字,没什么作用

	av_init_packet(&packet);
	packet.data = NULL;//这里填入一个指向完整H264数据帧的指针
	packet.size = 0;//这个填入H264数据帧的大小

	FILE *myH264 = fopen("1.264", "rb");//解码的文件264
	if(myH264 == NULL)
	{
		perror("cant open 264 file\n");
		return -1;
	}

	FILE *yuvfile = fopen("my264.yuv", "wb");//成功解码后保存成的YUV文件, 可以用YUV工具打开浏览
	if(yuvfile == NULL)
	{
		perror("cant open YUV file\n");
		return -1;
	}

	int readFileLen = 1;
	char readBuf[MAX_LEN];
	unsigned char *parseBuf = malloc(20*MAX_LEN);//这个地方浪费了我一个下午时间, 当时我用的是栈内存,即unsigned char parseBuf[20*MAX_LEN], 结果运行程序一直报错, 此处需要用堆内存才能正常解码
	int  parseBufLen = 0;

	int frameCount = 0;
	printf("begin...\n");
	printf("readBuf address  is %x\n", readBuf);
/////////////////////////SDL init////////////////////////////////////////
    SDL_Surface* hello = NULL;
    SDL_Surface* screen = NULL;

    //Start SDL
   // SDL_Init( SDL_INIT_EVERYTHING );
      SDL_Init(SDL_INIT_VIDEO);

    //Set up screen
    screen = SDL_SetVideoMode( 720, 576, 32, SDL_SWSURFACE );
    SDL_Overlay* overlay = SDL_CreateYUVOverlay(w, h, SDL_YUY2_OVERLAY, screen);

    
    SDL_LockSurface(screen);
    SDL_LockYUVOverlay(overlay);
unsigned char yuv422[768*576*2];
//////////////////////////////////////////////////////////////////////
	while(readFileLen > 0)//开始解码工作
	{
		//printf("begin...\n");
		readFileLen = fread(readBuf, 1, sizeof(readBuf), myH264);//首先从文件里读出数据
		if(readFileLen <= 0)
		{
			printf("read over\n");
			break;
		}
		else
		{
			int handleLen = 0;
			int handleFileLen = readFileLen;
			while(handleFileLen > 0)
			{
				int nLength = av_parser_parse2(avParserContext, codec_, &parseBuf, &parseBufLen, readBuf + handleLen, handleFileLen, 0, 0, 0);//查找264帧头
				
				handleFileLen -= nLength;
				handleLen += nLength;

				if(parseBufLen <= 0)//当parseBufLen大于0时,说明查找到了帧头
				{
					continue;
				}
				packet.size = parseBufLen;//将查找到的帧长度送入
				packet.data = parseBuf;//将查找到的帧内存送入
                                 if(frameCount>100)break;
				//printf("parseBuf address is %x\n", parseBuf);
				while(packet.size > 0)
				{//下面开始真正的解码
					int decodeLen = avcodec_decode_video2(codec_, pFrame_, &frameFinished, &packet);
					//if(decodeLen < 0)break;
					packet.size -= decodeLen;
					packet.data += decodeLen;
					if(frameFinished > 0)//成功解码
					{
						int picSize = codec_->height * codec_->width;
						//int newSize = picSize * 1.5;

						//申请内存
						//unsigned char *buf = malloc(newSize);

						int height = pFrame_->height;
						int width = pFrame_->width;

						//printf("OK, get data\n");
						//printf("Frame height is %d\n", height);
						//printf("Frame width is %d\n", width);
						frameCount ++;
						printf("Frame count is %d\n", frameCount);
                                                

	pgm_save(pFrame_->data[0], pFrame_->linesize[0],//保存Y
                 codec_->width, codec_->height, yuvfile);
	pgm_save(pFrame_->data[1], pFrame_->linesize[1],//保存U
                 codec_->width/2, codec_->height/2, yuvfile);
	pgm_save(pFrame_->data[2], pFrame_->linesize[2],//保存V
                 codec_->width/2, codec_->height/2, yuvfile);
                        
                        ///有了YUV数据, 后面可以用FFMPEG提供的转换方法,将其转成RGB数据,进行后续的显示或其它的图像处理工作
                                            ////sdl
                                                int i;
                                           /*     for(i=0;i<576;i++)
                                                {//fwrite(buf + i * wrap, 1, xsize, f);
                                                     memcpy(overlay->pixels[0]+i*720, pFrame_->data[0]+i*pFrame_->linesize[0], 720);                               
                                                }
		                                for(i=0;i<288;i++)
                                                {
						     memcpy(overlay->pixels[2]+i*360, pFrame_->data[1]+i*pFrame_->linesize[1], 360);
						     memcpy(overlay->pixels[1]+i*360, pFrame_->data[2]+i*pFrame_->linesize[2], 360);                                                                      }*/
	int k=0,y,x;	//yuv420  -> yuv422
       for( y=0;y<576;y++)
       {
            for( x=0;x<720;x++)
            {
                 yuv422[k++] = pFrame_->data[0][y*pFrame_->linesize[0]+x];
                 yuv422[k++] = x%2==0?pFrame_->data[1][(y/2)*pFrame_->linesize[1]+x/2]:pFrame_->data[2][(y/2)*pFrame_->linesize[2]+x/2];
            }
       }
         
         memcpy(overlay->pixels[0],yuv422, codec_->width*codec_->height*2);
						SDL_UnlockYUVOverlay(overlay);
						SDL_UnlockSurface(screen);
		
						rect.w = w;
						rect.h = h;
						rect.x = rect.y = 0;
						SDL_DisplayYUVOverlay(overlay, &rect);
		                            //sdl
						SDL_Delay(40);
					}
					else
						printf("failed to decodec\n");
				}
			}
		}
	}
       
    //////释放工作
	avcodec_close(codec_);
	av_free(codec_);
	av_free_packet(&packet);
	av_frame_free(&pFrame_);
    //SDL
        SDL_FreeYUVOverlay(overlay);
        SDL_FreeSurface(screen);
    //Quit SDL
        SDL_Quit();
	fclose(yuvfile);
	fclose(myH264);
	
}




相关文章
|
27天前
|
数据采集 大数据 Python
FFmpeg 在爬虫中的应用案例:流数据解码详解
在大数据背景下,网络爬虫与FFmpeg结合,高效采集小红书短视频。需准备FFmpeg、Python及库如Requests和BeautifulSoup。通过设置User-Agent、Cookie及代理IP增强隐蔽性,解析HTML提取视频链接,利用FFmpeg下载并解码视频流。示例代码展示完整流程,强调代理IP对避免封禁的关键作用,助你掌握视频数据采集技巧。
FFmpeg 在爬虫中的应用案例:流数据解码详解
|
1月前
|
Web App开发 缓存 Linux
FFmpeg开发笔记(三十六)Linux环境安装SRS实现视频直播推流
《FFmpeg开发实战》书中第10章提及轻量级流媒体服务器MediaMTX,适合测试RTSP/RTMP协议,但不适合生产环境。推荐使用SRS或ZLMediaKit,其中SRS是国产开源实时视频服务器,支持多种流媒体协议。本文简述在华为欧拉系统上编译安装SRS和FFmpeg的步骤,包括安装依赖、下载源码、配置、编译以及启动SRS服务。此外,还展示了如何通过FFmpeg进行RTMP推流,并使用VLC播放器测试拉流。更多FFmpeg开发内容可参考相关书籍。
49 2
FFmpeg开发笔记(三十六)Linux环境安装SRS实现视频直播推流
|
1月前
|
Linux
FFmpeg开发笔记(三十四)Linux环境给FFmpeg集成libsrt和librist
《FFmpeg开发实战》书中介绍了直播的RTSP和RTMP协议,以及新协议SRT和RIST。SRT是安全可靠传输协议,RIST是可靠的互联网流传输协议,两者于2017年发布。腾讯视频云采用SRT改善推流卡顿。以下是Linux环境下为FFmpeg集成libsrt和librist的步骤:下载安装源码,配置、编译和安装。要启用这些库,需重新配置FFmpeg,添加相关选项,然后编译和安装。成功后,通过`ffmpeg -version`检查版本信息以确认启用SRT和RIST支持。详细过程可参考书中相应章节。
48 1
FFmpeg开发笔记(三十四)Linux环境给FFmpeg集成libsrt和librist
|
2月前
|
编解码 Linux
FFmpeg开发笔记(二十八)Linux环境给FFmpeg集成libxvid
XviD是开源的MPEG-4视频编解码器,曾与DivX一起用于早期MP4视频编码,但现在已被H.264取代。要集成XviD到Linux上的FFmpeg,首先下载源码,解压后配置并编译安装libxvid。接着,在FFmpeg源码目录中,重新配置FFmpeg以启用libxvid,然后编译并安装。成功后,通过`ffmpeg -version`检查是否启用libxvid。详细步骤包括下载、解压libxvid,使用`configure`和`make`命令安装,以及更新FFmpeg配置并安装。
50 2
FFmpeg开发笔记(二十八)Linux环境给FFmpeg集成libxvid
|
1月前
|
语音技术 C语言 Windows
语音识别------ffmpeg的使用01,ffmpeg的安装,会做PPT很好,ffmpeg不具备直接使用,只可以操作解码数据,ffmpeg用C语言写的,得学C语言,ffmpeg的安装
语音识别------ffmpeg的使用01,ffmpeg的安装,会做PPT很好,ffmpeg不具备直接使用,只可以操作解码数据,ffmpeg用C语言写的,得学C语言,ffmpeg的安装
|
2月前
|
Web App开发 安全 Linux
FFmpeg开发笔记(二十六)Linux环境安装ZLMediaKit实现视频推流
《FFmpeg开发实战》书中介绍轻量级流媒体服务器MediaMTX,但其功能有限,不适合生产环境。推荐使用国产开源的ZLMediaKit,它支持多种流媒体协议和音视频编码标准。以下是华为欧拉系统下编译安装ZLMediaKit和FFmpeg的步骤,包括更新依赖、下载源码、配置、编译、安装以及启动MediaServer服务。此外,还提供了通过FFmpeg进行RTSP和RTMP推流,并使用VLC播放器拉流的示例。
116 3
FFmpeg开发笔记(二十六)Linux环境安装ZLMediaKit实现视频推流
|
2月前
|
存储 编解码 Ubuntu
【QT】linux下alsa库的移植和QT中音视频的处理&笔记
【QT】linux下alsa库的移植和QT中音视频的处理&笔记
|
2月前
|
Linux 开发工具
Linux下视频截取命令 使用【ffmpeg】使用
Linux下视频截取命令 使用【ffmpeg】使用
29 1
|
2月前
|
网络协议 Linux 编译器
【原创】EtherCAT主站IgH解析(二)-- 如何将Igh移植到Linux/Windows/RTOS等多操作系统移植指南
EtherCAT主站方案对比:商业的如Acontis、TwinCAT3和开源的igh、SOEM。SOEM易移植但功能和实时性不足,适合简单应用;igh功能强大,实时性能优秀,基于内核态,适合复杂场景。igh能移植到其他RTOS,但需克服多任务无调度的挑战。依赖操作系统服务如定时器、内存分配,适合Linux内核,但移植到裸机复杂。
|
1天前
|
JavaScript 前端开发 Java
FFmpeg开发笔记(四十七)寒冬下安卓程序员的几个技术转型发展方向
IT寒冬使APP开发门槛提升,安卓程序员需转型。选项包括:深化Android开发,跟进Google新技术如Kotlin、Jetpack、Flutter及Compose;研究Android底层框架,掌握AOSP;转型Java后端开发,学习Spring Boot等框架;拓展大前端技能,掌握JavaScript、Node.js、Vue.js及特定框架如微信小程序、HarmonyOS;或转向C/C++底层开发,通过音视频项目如FFmpeg积累经验。每条路径都有相应的书籍和技术栈推荐,助你顺利过渡。
12 3
FFmpeg开发笔记(四十七)寒冬下安卓程序员的几个技术转型发展方向