python ffmpeg 问题 [问题点数:20分]

Bbs1
本版专家分:0
结帖率 33.33%
ffmpegpython的解决方案
用于<em>python</em>内部使用subprocess模块调用外部的<em>ffmpeg</em>进行音频视频处理,常见功能有转码、视频合成,音频合成,音频合成到视频等。
ffmpeg问题
刚用<em>ffmpeg</em> 请问可以将音视频流存储为MP4文件吗? rn具体该怎么做?我找了好些资料,主要是讲编码解码的。 <em>ffmpeg</em>是否就是一个相当于dll的一个东西,有很多库函数可以调用?
ffmpeg问题
使用<em>ffmpeg</em>解码视频播放时,右侧会出现色条,也不是所有的视频都是这样,目前发现有些100*40的视频会有这种情况,如果解码时倍数放大,显示时又没有这种情况,遇到这种<em>问题</em>很费解。rn程序主要代码如下:rn // 【1】rn int size = av_image_get_buffer_size(AV_PIX_FMT_RGB24, dst_width, dst_height,1);rn imagedata = (unsigned char *)av_malloc(size);rn av_image_fill_arrays(framergb->data, framergb->linesize,imagedata,rn AV_PIX_FMT_RGB24, dst_width, dst_height, 1);rnrn img_convert_ctx = sws_getContext(src_width, src_height, codecontext->pix_fmt,rn dst_width, dst_height, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR, NULL, NULL, NULL);rnrn // 【2】rn sws_scale(img_convert_ctx, (const uint8_t* const*)frame->data, frame->linesize, 0,rn src_height, framergb->data, framergb->linesize);rnrn这是视频的一些信息rn[img=https://img-bbs.csdn.net/upload/201804/28/1524899333_636737.jpg][/img]rn这是播放的画面(很小,与视频宽度高度大小相同),会发现右侧出现不同颜色的色条,用电脑播放器播放就没发现这个<em>问题</em>rn[img=https://img-bbs.csdn.net/upload/201804/28/1524900293_330515.png][/img]rnrn谢谢大家帮忙解答
ffmpeg问题!!!
菜鸟<em>问题</em>,我想用<em>ffmpeg</em>(只想用它)转换一个.ts的文件为flv,但苦于我没有他的音频解码器,所以现在暂且只能转换他的视频文件,请问如何只转换视频????rn还有,有什么好的软件可以查看媒体文件的音频类型吗??(我的文件音频好像是高品位的acc)。rn[color=#FF0000][b]在线等!!![/b][/color]
windows下ffmpeg的安装与python调用
在没有安装<em>ffmpeg</em>前直接在<em>python</em>中使用,会报出如下一串红色问号 需要先安装<em>ffmpeg</em> 教程|https://<em>ffmpeg</em>.zeranoe.com/builds/ pip install <em>ffmpeg</em>和ffmpy 完成 https://blog.csdn.net/kingvon_liwei/article/details/79271361ffmpy常用命令汇总 ...
ffmpeg 截取视频片段 - python
<em>ffmpeg</em> -i plutopr.mp4 -vcodec copy -acodec copy -ss 00:00:10 -to 00:00:15 cutout1.mp4 参数解析 -vcodec copy表示使用跟原视频一样的视频编解码器。 -acodec copy表示使用跟原视频一样的音频编解码器。 -i 表示源视频文件 -ss: time_off set the start time o...
python 调用 ffmpeg 各项操作
vp=CutSplicingVdeio()#class instance filePath=r&amp;quot;E:\my.avi&amp;quot; videoStartTime=&amp;quot;00:00:0.0&amp;quot; videoEndTime=&amp;quot;00:00:8.0&amp;quot; #videoSaveDir1=r&amp;quot;‪E:\animation\Wisp_03.mov&amp;quot; videoPath=r&amp;quot;‪E:\liu
在分布式系统中使用ffmpeg -- python
<em>ffmpeg</em>是常用的用来处理视频的工具,它的功能非常强大,包含了丰富的音视频处理接口,如视频格式转换,音视频分离、添加水印等。出于效率上的考虑,<em>ffmpeg</em>是基于c编写的,所以在使用之前通常需要编译安装。想要在分布式集群上面用<em>ffmpeg</em>,需要在每台机器上安装<em>ffmpeg</em>或者用预先编译好的包。本文将详细介绍如何在分布式集群上使用预先编译好的<em>ffmpeg</em>包。 1、imageio-<em>ffmpeg</em>自动...
python使得ffmpeg更加强大
录制项目终于做完,不用总是提醒自己抓紧时间这样来想<em>问题</em>了。在完成之后带着一些满足感,回头看看哪些地方是需要改进的,哪些地方又是有更好的替代方案,自己又有哪些不足。 下面按照软件的各部分分别作总结记录: 0. 软件应用场景:   客户希望用视频+音频的方式录制下会议的内容。除了录制会议室情况之外,会议中还有可能需要录制电脑屏幕内容,比如在做...
ffmpeg——ffmpeg简要
FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。采用LGPL或GPL许可证。它提供了录制、转换以及流化音视频的完整解决方案。它包含了非常先进的音频/视频编解码库libavcodec,为了保证高可移植性和编解码质量,libavcodec里很多code都是从头开发的。 FFmpeg在Linux平台下开发,但它同样也可以在其它操作系统环境中编译运行,包括Windo
ffmpeg
最近开始接触这个,有没有相关的qq群之类的可以交流的地方呢。。rn
ffmpeg + ffmpeg参数说明书
通过<em>ffmpeg</em>,可以将多种视频文件,转换成FLV格式.并且支持截图操作.
ffmpeg学习笔记-初识ffmpeg
<em>ffmpeg</em>用来对音视频进行处理,那么在使用<em>ffmpeg</em>前就需要<em>ffmpeg</em>有一个大概的了解,这里使用雷神的ppt素材进行整理,以便于复习 音视频基础知识 视频播放器的原理 播放视频的流程大致如下: 常用播放器 跨平台 VLC,Mplayer,ffplay等 Windows平台 完美解码,终极解码,暴风影音 信息查看工具...
ffmpeg安装,ffmpeg转码,ffmpeg抽图,ffmpeg字幕
<em>ffmpeg</em>,视频转码,视频抽图,视频字幕处理,<em>ffmpeg</em>字幕,<em>ffmpeg</em>转码,<em>ffmpeg</em>抽图
ffmpeg 编译问题
交叉编译<em>ffmpeg</em> 没有<em>问题</em>,安装也没有<em>问题</em>,可是在编译例子时出现头文件找不到rn是交叉编译配置有<em>问题</em>吗???rnopt/Atmel/arm-2007q1/bin/arm-linux-gcc -o tt tutorial01.c -lavformat -lavcodec -lz -lmrntutorial01.c:22:21: error: avcodec.h: No such file or directoryrntutorial01.c:23:22: error: avformat.h: No such file or directoryrntutorial01.c:27: error: expected ')' before '*' tokenrntutorial01.c: In function 'main':rntutorial01.c:50: error: 'AVFormatContext' undeclared (first use in this function)rntutorial01.c:50: error: (Each undeclared identifier is reported only oncerntutorial01.c:50: error: for each function it appears in.)rntutorial01.c:50: error: 'pFormatCtx' undeclared (first use in this function)rntutorial01.c:52: error: 'AVCodecContext' undeclared (first use in this function)rntutorial01.c:52: error: 'pCodecCtx' undeclared (first use in this function)rntutorial01.c:53: error: 'AVCodec' undeclared (first use in this function)rntutorial01.c:53: error: 'pCodec' undeclared (first use in this function)rntutorial01.c:54: error: 'AVFrame' undeclared (first use in this function)rntutorial01.c:54: error: 'pFrame' undeclared (first use in this function)rntutorial01.c:55: error: 'pFrameRGB' undeclared (first use in this function)rntutorial01.c:56: error: 'AVPacket' undeclared (first use in this function)rntutorial01.c:56: error: expected ';' before 'packet'rntutorial01.c:59: error: 'uint8_t' undeclared (first use in this function)rntutorial01.c:59: error: 'buffer' undeclared (first use in this function)rntutorial01.c:82: error: 'CODEC_TYPE_VIDEO' undeclared (first use in this function)rntutorial01.c:111: error: 'PIX_FMT_RGB24' undeclared (first use in this function)rntutorial01.c:113: error: expected expression before ')' tokenrntutorial01.c:118: error: 'AVPicture' undeclared (first use in this function)rntutorial01.c:118: error: expected expression before ')' tokenrntutorial01.c:123: error: 'packet' undeclared (first use in this function)rntutorial01.c:133: error: expected expression before ')' token
编译ffmpeg到Android下的问题
/home/asd/ndk7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ld: libavfilter/libavfilter.a: No such file: No such file or directoryrncp: 无法获取"/home/asd/ndk7/platforms/android-8/arch-arm/usr/lib<em>ffmpeg</em>.so" 的文件状态(stat): 没有那个文件或目录rnrnrn最后一步出现了这个<em>问题</em>。有人知道是哪里有<em>问题</em>吗?rn
ffmpeg open问题
做H264视频解码部分,用到FFmpeg的H264解码,如果只有一个视频通道初始化的时候是没有<em>问题</em>的,rn但是在多通道同时初始化的时候,就是出现avcodec_open2返回失败的可能rn打印信息: insufficient thread locking around avcodec_open/close()rn想问一下<em>ffmpeg</em>不支持多线程吗?rn在多线程同时打开的时候,有什么避免出现那种情况?rn有没有做过H264解码的指点一下啊rn[code=c]avcodec_register_all();rn //av_dict_set(&opts, "b", "2.5M", 0);rn //av_register_all(); rn /* find the h264 video decoder */rn pDec->codec = avcodec_find_decoder(CODEC_ID_H264);rn if (!pDec->codec)rn rn fprintf(stderr, "avcodec_find_decoder fail\n");rn goto ERROR_DEC_CREATE;rn rn rn pDec->c = avcodec_alloc_context3(pDec->codec);rn if (!pDec->c)rn rn fprintf(stderr, "avcodec_alloc_context3 fail\n");rn goto ERROR_DEC_CREATE;rn rn rn if(pDec->codec->capabilities&CODEC_CAP_TRUNCATED)rn pDec->c->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */rn rn /* For some codecs, such as msmpeg4 and mpeg4, width and heightrn MUST be initialized there because this information is notrn available in the bitstream. */rn rn /* open it */rnrn //av_lockmgr_register(lockmgr);rn //多线程情况下,avcodec_open2有时候返回失败rn if ((s32Ret = avcodec_open2(pDec->c, pDec->codec, NULL)) < 0) rn rn fprintf(stderr, "Could not open codec:%d\n", s32Ret);rn goto ERROR_DEC_CREATE;rn rn rnrn pDec->picture = avcodec_alloc_frame();rn if (!pDec->picture) rn rn fprintf(stderr, "Could not allocate video frame\n");rn goto ERROR_DEC_CREATE;rn rnrn return pDec;[/code]
编译FFMPEG时候的问题
编译<em>ffmpeg</em>的时候,会出现以下情况:rncfz@cfz-virtual-machine:~/桌面/wma/源代码/gst-<em>ffmpeg</em>-0.10.12$ ./configurernchecking for a BSD-compatible install... /usr/bin/install -crnchecking whether build environment is sane... yesrnchecking for a thread-safe mkdir -p... /bin/mkdir -prnchecking for gawk... nornchecking for mawk... mawkrnchecking whether make sets $(MAKE)... yesrnchecking nano version... 0 (release)rnchecking whether to enable maintainer-specific portions of Makefiles... nornchecking build system type... x86_64-unknown-linux-gnurnchecking host system type... x86_64-unknown-linux-gnurnchecking how to print strings... printfrnchecking for style of include used by make... GNUrnchecking for gcc... gccrnchecking whether the C compiler works... nornconfigure: error: in `/home/cfz/桌面/wma/源代码/gst-<em>ffmpeg</em>-0.10.12':rnconfigure: error: C compiler cannot create executablesrnSee `config.log' for more detailsrn这个是这么回事呢?
FFmpeg 相关问题
这里有人熟悉FFmpeg解码库吗?rnrnudp://@:1111rnrn这样的URL地址,,用FFmpeg该如何去调用才可以打开啊?rnrn用KxMovie播放不了这样的地址,用VLC是可以播放,但目前需要直接使用FFmpeg这个层次上面的调用,VLC代码看起太痛苦了,跟踪不到里面FFmpeg层是如何打开这样的URL的。rnrnrn有经验的大虾请指点下。
ffmpeg编译错误的问题
最近要做一个android多格式播放器,需要使用<em>ffmpeg</em>,在网上查了一些资料rnhttp://zouyuefen.blog.163.com/blog/static/102780156201111312130944/rn跟着这个教程做了一些,可是在./config.sh 的时候还是出错了。说rn......gcc is unable to create an executable file.rnC compiler test failed.rnrn看了教程的提示说需要建立一个TMPDIR,我也跟着做了,可以是还是出现这个错误。rn所以我不知道我哪里出了错,望大牛能够给点提示。
ffmpeg内存释放问题
最近改了个视频解码编码的小程序,能得到最后的结果,但是内存老是释放不了,希望高手指点!附代码如下:rnrnconst char *input_file_name="/users/sj/desktop/HH_videoTransform2/input.mov";rn av_register_all();//注册库中所有可用的文件格式和编码器rn AVFormatContext *ic;rn //输入文件处理部分rn ic=avformat_alloc_context();rn if(av_open_input_file(&ic,input_file_name,NULL,0,NULL)!=0)rn rn printf("can't open the file %s\n",input_file_name);rn exit(1);rn //打开输入文件rn if(av_find_stream_info(ic)streams->codec->codec_type==CODEC_TYPE_VIDEO)rn rn videoindex=i;rn //printf("video\n");rn rn else if(ic->streams->codec->codec_type==CODEC_TYPE_AUDIO)rn rn //printf("audio\n");rn audioindex=i;rn rn rn if(videoindex==-1)rn rn printf("can't find video stream\n");rn exit(1);rn //没有找到视频流rn AVCodecContext *vCodecCtx;rn vCodecCtx=ic->streams[videoindex]->codec;//取得视频流编码上下文指针rn AVCodec *vCodec;rn vCodec=avcodec_find_decoder(vCodecCtx->codec_id);rn if(vCodec==NULL)rn rn printf("can't find suitable video decoder\n");rn exit(1);rn //找到合适的视频解码器rn if(avcodec_open(vCodecCtx,vCodec)oformat=fmt;rnrn strcpy(oc->filename, output_file_name);rn video_st=av_new_stream(oc,0);rn if(!video_st)rn rn printf("could not alloc video stream\n");rn exit(0);rn rn video_st->duration=ic->streams[videoindex]->duration;rn if (fmt->video_codec != CODEC_ID_NONE)rn rnrn oVcc=avcodec_alloc_context();rn oVcc=video_st->codec;rn oVcc->codec_id=fmt->video_codec;rn oVcc->codec_type=CODEC_TYPE_VIDEO;rn oVcc->bit_rate=vCodecCtx->bit_rate;rn oVcc->width=vCodecCtx->width;rn oVcc->height=vCodecCtx->height;rn oVcc->time_base=vCodecCtx->time_base;rn oVcc->gop_size=vCodecCtx->gop_size;rn //oVcc->pix_fmt=vCodecCtx->pix_fmt;rn oVcc->pix_fmt=vCodecCtx->pix_fmt;rn oVcc->max_b_frames=vCodecCtx->max_b_frames;rn video_st->r_frame_rate=ic->streams[videoindex]->r_frame_rate;rnrnrn if (oVcc->codec_id == CODEC_ID_MPEG2VIDEO)rn rn oVcc->max_b_frames = 2;rn rn if (oVcc->codec_id == CODEC_ID_MPEG1VIDEO)rn rn oVcc->mb_decision = 2;rn rn if (!strcmp(oc->oformat->name, "mp4") || !strcmp(oc->oformat->name, "mov") || !strcmp(oc->oformat->name, "3gp"))rn rn oVcc->flags |= CODEC_FLAG_GLOBAL_HEADER;rn rnrnrn rn if (av_set_parameters(oc, NULL) < 0)rn rn printf( "Invalid output format parameters\n");rn exit(0);rn //设置必要的输出参数rnrn strcpy(oc->title,ic->title);rn strcpy(oc->author,ic->author);rn strcpy(oc->copyright,ic->copyright);rn strcpy(oc->comment,ic->comment);rn strcpy(oc->album,ic->album);rn oc->year=ic->year;rn oc->track=ic->track;rn strcpy(oc->genre,ic->genre);rn dump_format(oc,0,output_file_name,1);//列出输出文件的相关流信息rn // oVc=avcodec_find_encoder(CODEC_ID_MPEG4);rn oVc=avcodec_find_encoder(oVcc->codec_id);rn if(!oVc)rn rn printf("can't find suitable video encoder\n");rn exit(0);rn //找到合适的视频编码器rn if(avcodec_open(oVcc,oVc)flags & AVFMT_NOFILE))rn rn if(url_fopen(&oc->pb,output_file_name,URL_WRONLY)nb_streams)rn rn fprintf(stderr,"output file dose not contain any stream\n");rn exit(0);rn //查看输出文件是否含有流信息rn if(av_write_header(oc)width*vCodecCtx->height*3/2+100000;rn video_outbuf= (unsigned char *) malloc(video_outbuf_size);rn int got_picture=0;rn int len;rn int frame_index=0,ret;rn int packet_count=0;rn int skipped_frame=0;rn //int packet_audio=0;rn while(av_read_frame(ic,&packet)>=0)//从输入文件中读取一个包rn rn if(packet.stream_index==videoindex)//判断是否为当前视频流中的包rn NSLog(@"%d packet decoded",packet_count);rn len=avcodec_decode_video2(vCodecCtx, oVFrame, &got_picture, &packet);rn if(lenpts=av_rescale_q(packet.pts, ic->streams[videoindex]->time_base, video_st->time_base);rn oVFrame->pict_type=0;rn out_size = avcodec_encode_video(oVcc, video_outbuf, video_outbuf_size, oVFrame);rn if (out_size > 0)rn rn AVPacket pkt;rn av_init_packet(&pkt);rn if(oVcc->coded_frame && oVcc->coded_frame->key_frame)rn pkt.flags |= PKT_FLAG_KEY;rn pkt.flags = packet.flags;rn pkt.stream_index= video_st->index;rn pkt.data= video_outbuf;rn pkt.size= out_size;rn ret=av_write_frame(oc, &pkt);rn rn skipped_frame++;rn rn elsern rn ret=av_write_frame(oc, &packet); rn rn frame_index++;rn if(ret!=0)rn rn printf("while write video frame error\n");rn exit(0);rn rn packet_count++;rn rn else if(packet.stream_index==audioindex)rn rnrnrn if (av_write_frame(oc, &packet) != 0)rn rn fprintf(stderr, "Error while writing audio frame\n");rn exit(1);rn rnrn rn av_free_packet(&packet);rn rnrnrn av_write_trailer(oc);rn for(i = 0; i < oc->nb_streams; i++)rn rn av_freep(&oc->streams->codec);rn av_freep(&oc->streams);rn rn url_fclose(oc->pb);rnrn av_free(oVFrame);rn avcodec_close(vCodecCtx);rn av_close_input_file(ic);rn av_freep(ic); rn av_free(oc); rn av_free(oVc); rn av_free(oVcc); rn av_free(oAc); rn av_free(oAcc);rnrn NSLog(@"transform end");rnrnrnrnrn为什么我已经都av_free了,但是ic 、oc、oAcc,oAc,oVcc,oVc都还是在内存中呢,是不是释放内存的方法不对?rn
ffmpeg关于av_seek_frame的问题
关于av_seek_frame的<em>问题</em>,这个函数看源码不支持相对偏移时间,我想先按照bytes模式来seek frame,rn之后再按照time来偏移相对时间。但是看源码是每次av_seek_frame都是从stream的开始位置,即SEEK_SETrn位置,而不是SEEK_CUR位置。各位大侠有什么好的解决办法么?rnrn<em>ffmpeg</em>仔细看了api,貌似没有这个接口。rn
关于ffmpeg编解码的问题
我现在有几个疑问:rnrn我用<em>ffmpeg</em>做音频的编解码,在编码之前可能需要先做解码,假设编码的帧是一个超大帧,通过网络传输,理论上是应该先把帧折成小块封装成一定格式的数据包(有协议,协议里头有帧标识号,序列号,当前帧的小块总等信息)再进行网络传输,现在的疑问是:如果重现丢包,和包乱序(这个乱序我可以进行包序重排)等意外情况,造成帧内部的小块丢失,<em>ffmpeg</em>能不能自动实现帧的重组,如果<em>ffmpeg</em>不能自己重组,是否要在接收端自己判断帧是否接收完整,再传给<em>ffmpeg</em>进行解码?rnrnrn还有关于这个 <em>ffmpeg</em> 的av_interleaved_write_frame 接口,能自动识别帧是否完整,再进行帧保存写入吗?rn假设编码的帧是一个超大帧,通过网络传输,理论上是应该先把帧折成小块封装成一定格式的数据包(有协议,协议里头有帧标识号,序列号,当前帧的小块总等信息)再进行网络传输,现在的疑问是:如果重现丢包,和包乱序(这个乱序我可以进行包序重排)等意外情况,造成帧内部的小块丢失,用av_interleaved_write_frame 接口保存帧的时候,av_interleaved_write_frame 能不能自动实现帧的重组和帧是否完整的检测,如果av_interleaved_write_frame 不能自己重组,是否要在接收端自己判断帧是否接收完整,再调用 av_interleaved_write_frame 进行保存写入?rn
FFmpeg的使用问题
<em>问题</em>1: rtmp://192.168.1.11/xxx       Input/output error    解决方案:出现这个<em>问题</em>的原因是live的名字与nginx.conf中的rtmp名字不同,改成相同即可   <em>问题</em>2: connection to tcp://192.168.1.11:1935 failed:connection refuseed    解决方案:出现的原...
ffmpeg编译问题
看过网上很多编译心得,自己尝试去编译,确始终不能通过,遇到的<em>问题</em>在网上也没法找到。rnwindows下,用msys+mingw方案,rn./configure ....时候,会出现pr: command not found的<em>问题</em>,这是bash不支持pr打印命令,改成lpr就行。rn但是make的时候就会出现错误rnNo rule to make target 'libavdevice/avdevice.dll', needed by 'all'. Stoprn不知道论坛上有人有同样的经历没有,望赐教。rn我才来这里,分数比较少,不能开很高“价钱”:)
ffmpeg arm加速问题
本人想在wince系统下开发视频软件。目前porting 完成<em>ffmpeg</em>.rn发现<em>ffmpeg</em>中有armv4,armv5,armv6的有关idct部分的代码,rn armv4,armv5部分通过config已经编译通过,但是发现好像没有地方使用,不知道这部分的代码是否可以使用在<em>ffmpeg</em>中。rn armv6的config开放后没有办法编译通过。rn两个<em>问题</em>请高手指点
网络版ffmpeg解码的问题
上次用<em>ffmpeg</em>做了一个播放文件的本地播放器,效果不错。这次公司让我做一个网络版的播放器,一想到<em>ffmpeg</em>来解码服务器发过来的mp4视频数据包就没了主意,自己做的实验老是通不过。rn诸位,谁有这方面的经验,可否告知一二,如分数不够,还可以加分。
[SOS]ffmpeg问题
大家好,小弟是刚接触<em>ffmpeg</em>的新手,有<em>问题</em>想请教各位:rn 我想通过<em>ffmpeg</em>得到视频文件的总帧数,文件的总时间以及码率,通过网上查找的资料写了段代码,但是没有成功,代码如下:rn[code=C/C++]rn av_register_all();rnrn err = av_open_input_file(&fctx, "s", NULL, 0, NULL);rn if (err < 0) rn fprintf(stderr, "av_open_input_file: error %d\n", err);rn return 1;rn rnrn err = av_find_stream_info(fctx);rn if (err < 0) rn fprintf(stderr, "av_find_stream_info: error %d\n", err);rn return 1;rn rnrn dump_format(fctx, 0, "s", 0);rn[/code]rnrn dump_format(fctx, 0, "s", 0);rn 这个函数得到的内容如下:rn Input #0, h264, from 's':rn Duration: N/A, bitrate: N/Arn Stream #0.0: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 25 tbr, 1200k tbn, 50 tbcrnrn fctx->bit_rate 结果是 0rn pkt.duration 结果是一个超大的数;rnrn 还有就是想知道 25 tbr, 1200k tbn, 50 tbc 这是什么意思?rn 谢谢大家,给各位添加麻烦了!rn
问些ffmpeg问题
请问一下大家<em>ffmpeg</em>中的音频编解码的<em>问题</em>rnavcodec_encode_audio()中的最后一个参数short *samples,是如何组成的rn我想把捕获的PCM数据用它编码,PCM数据存在一个char* buf中,rn请问如何把buf中的数据转成samples*,输入buf的大小是多少,每次由多大的buf转成samples
ffmpeg相关问题求教
rn1.如何实现视频文件的裁剪?rn2.如何添加字幕?rn3.顺便求sdk3.2相应的ffplay.c源码rnrn刚学<em>ffmpeg</em>,百思不得其解。。。rnchinavideo注册的帐号一直不能登录。。。不知道是不是不让注册了。rn希望前辈们不吝赐教。
ffmpeg 静态链接的问题
自己下载的<em>ffmpeg</em>静态编译后,生成的*.a文件,如何链接到VS工程中?rn各种方式都试过了,总是报rnrnSeverity Code Description Project File Line Suppression StaternError LNK2019 unresolved external symbol "void __cdecl av_register_all(void)" (?av_register_all@@YAXXZ) referenced in function "public: void __thiscall CMainFrame::OnPlayPlay(void)" (?OnPlayPlay@CMainFrame@@QAEXXZ) FFMPEG I:\Studio\Visual Studio\Projects\MFC\FFMPEG\MainFrm.obj 1 rn
ffmpeg 水印问题
一、<em>ffmpeg</em>添加水印的2中方式: fmpeg -y -i demo.3gp -i icon-72.png -filter_complex overlay=10:10 -vcodec li bx264 -acodec copy -strict -2 merge.3gp 或者  <em>ffmpeg</em> -i input  -vf 'movie=long.png[logo];[in][logo]ove
ffmpeg遇到的问题
编译时遇到的<em>问题</em>: /bin/sh: 1: ctags: not found 解决方案:     sudo apt-get install ctags 遇到的<em>问题</em> /usr/bin/ld: /home/fengxi/<em>ffmpeg</em>_build/lib//libavcodec.a(dds.o): undefined reference to symbol 'sqrtf@@GLIB
ffmpeg】codec的使用问题
  从avcodec_decode_video2()中解码出来,得到的数据放在结构体 AVFrame中,根据截取需要,满足截取条件时,将上述的frame调用编码接口:avcodec_encode_video2,进行编码(注:在此过程中,我们对pts进行重置操作), 编码可以顺利完成,但是有警告信息出现,类似如下(我们底层用的编码器是264):    [libx264 @ 0x34b88a0] sp...
ffmpeg 在cron中的问题
在php脚本里面用exec 执行 <em>ffmpeg</em> 生成图片没有任何<em>问题</em>,但是用cron来执行就死活不行。 无语。被困了一天 到晚上终于想到办法 在cron中用 wget 走web服务器层 尼玛<em>问题</em>解决!
ffmpeg在ppc和smartphone下的问题
各位大虾,我想请问一下,为什么在ppc 5.0 上使用<em>ffmpeg</em>和sdl的视频播放程序成编译运行,换成smartphone 5.0就不能编译通过呢?而且,出现的<em>问题</em>是关于winbase.h,winnt.h和excpt.h的.
centos5安装ffmpeg问题
在安装a52dec是出现如下信息:rn[root@localhost a52dec-0.7.4]# ./configure --prefix=/usr --enable-a52 --enable-gplrnchecking for a BSD-compatible install... /usr/bin/install -crnchecking whether build environment is sane... yesrnchecking whether make sets $MAKE... yesrnchecking for working aclocal... missingrnchecking for working autoconf... missingrnchecking for working automake... missingrnchecking for working autoheader... missingrnchecking for working makeinfo... missingrnchecking whether to enable maintainer-specific portions of Makefiles... nornchecking build system type... i686-pc-linux-gnurnchecking host system type... i686-pc-linux-gnurnchecking for gcc... gccrnchecking for C compiler default output... a.outrnchecking whether the C compiler works... yesrnchecking whether we are cross compiling... nornchecking for suffix of executables... rnchecking for suffix of object files... ornchecking whether we are using the GNU C compiler... yesrnchecking whether gcc accepts -g... yesrnchecking how to run the C preprocessor... gcc -Ernchecking whether gcc needs -traditional... nornchecking if gcc supports -g -O3 flags... yesrnchecking if gcc supports -g -O3 -fomit-frame-pointer flags... yesrnchecking if gcc supports -g -O3 -fomit-frame-pointer -mcpu=pentiumpro flags... yesrnchecking for ld used by GCC... /usr/bin/ldrnchecking if the linker (/usr/bin/ld) is GNU ld... yesrnchecking for /usr/bin/ld option to reload object files... -rrnchecking for BSD-compatible nm... /usr/bin/nm -Brnchecking whether ln -s works... yesrnchecking how to recognise dependant libraries... pass_allrnchecking command to parse /usr/bin/nm -B output... okrnchecking for ANSI C header files... yesrnchecking for sys/types.h... yesrnchecking for sys/stat.h... yesrnchecking for stdlib.h... yesrnchecking for string.h... yesrnchecking for memory.h... yesrnchecking for strings.h... yesrnchecking for inttypes.h... yesrnchecking for stdint.h... yesrnchecking for unistd.h... yesrnchecking dlfcn.h usability... yesrnchecking dlfcn.h presence... yesrnchecking for dlfcn.h... yesrnchecking for ranlib... ranlibrnchecking for strip... striprnchecking for objdir... .libsrnchecking for gcc option to produce PIC... -fPICrnchecking if gcc PIC flag -fPIC works... yesrnchecking if gcc static flag -static works... yesrnchecking if gcc supports -c -o file.o... nornchecking if we can lock with hard links... yesrnchecking if gcc supports -fno-rtti -fno-exceptions... yesrnchecking whether the linker (/usr/bin/ld) supports shared libraries... yesrnchecking how to hardcode library paths into programs... immediaternchecking whether stripping libraries is possible... yesrnchecking dynamic linker characteristics... GNU/Linux ld.sornchecking if libtool supports shared libraries... yesrnchecking whether to build shared libraries... nornchecking whether to build static libraries... yesrncreating libtoolrnchecking sys/time.h usability... yesrnchecking sys/time.h presence... yesrnchecking for sys/time.h... yesrnchecking sys/timeb.h usability... yesrnchecking sys/timeb.h presence... yesrnchecking for sys/timeb.h... yesrnchecking io.h usability... nornchecking io.h presence... nornchecking for io.h... nornchecking for inttypes.h... (cached) yesrnchecking for gcc option to accept ANSI C... none neededrnchecking for an ANSI C-conforming const... yesrnchecking for inline... inlinernchecking for always_inline... yesrnchecking for restrict... __restrict__rnchecking for size_t... yesrnchecking whether byte ordering is bigendian... nornchecking for memalign... yesrnchecking for gettimeofday... yesrnchecking for ftime... yesrnchecking return type of signal handlers... voidrnchecking for _oss_ioctl in -lossaudio... nornchecking __attribute__ ((aligned ())) support... 64rnconfigure: creating ./config.statusrnconfig.status: creating Makefilernconfig.status: creating autotools/Makefilernconfig.status: creating include/Makefilernconfig.status: creating test/Makefilernconfig.status: creating doc/Makefilernconfig.status: creating src/Makefilernconfig.status: creating liba52/Makefilernconfig.status: creating libao/Makefilernconfig.status: creating vc++/Makefilernconfig.status: creating include/config.hrnconfig.status: include/config.h is unchangedrnconfig.status: executing default-1 commandsrnrn哪位知道是什么原因?
ffmpeg 运行的问题
windows 下 我用<em>ffmpeg</em> -i d:\qlzw.mp3 -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 d:\qlzw.flv 转换成功rnrn服务器linux+apache下我用system()或者exec()都无法转换成功rnmp3文件一样 命令也一样rnrn在服务器上运行时 只是mp3和flv文件的路径不同rn条件:system()有权限运行,mp3文件能找到,flv所在文件夹有写入权限rnrn运行上面的命令就是不能转换rnrn谁能告知为什么?rn
ffmpeg在centos5下的编译问题
[root@localhost <em>ffmpeg</em>]# ./configure --prefix=/usr --enable-gpl --enable-shared --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libx264 --enable-pthreads --disable-ffserver --disable-ffplay --enable-liba52 --enable-liba52bin --enable-libamr-nb --enable-libamr-wbrnlibamr is nonfree and --enable-nonfree is not specified.rnIf you think configure made a mistake, make sure you are using the latestrnversion from SVN. If the latest version fails, report the problem to thern<em>ffmpeg</em>-user@mplayerhq.hu mailing list or IRC #<em>ffmpeg</em> on irc.freenode.net.rnInclude the log file "config.err" produced by configure as this will helprnsolving the problem.rnrn哪位知道是什么原因?帮帮忙阿!
ffmpeg库的编译问题
我用配置好的mingw+msys环境,gcc编译器编译<em>ffmpeg</em>库生成的DLL为什么总是有两个大小一样的DLL文件呢,比如生成的dll有两个:avutil.dll avutil-50.dll,这两个文件好像是一样,请问为什么会这样,是我的环境有<em>问题</em>吗?急切等待
使用FFMPEG截图的问题
有个FLV文件, 1小时长,我想截其中指定时间点的图,rn但发现截图时,时间点越往后用的时间越多,请大家指点。rn下面是我截图用以的命令 rn<em>ffmpeg</em> -i a.flv -an -ss 1 -f mjpeg -t 1 -r 1 -y -s 640x480 b1.jpg 2>&1 快rn<em>ffmpeg</em> -i a.flv -an -ss 100 -f mjpeg -t 1 -r 1 -y -s 640x480 b100.jpg 2>&1 慢rnrn rn
ffmpeg SDK使用问题
我使用<em>ffmpeg</em> SDK解码h.264文件 希望直接输出RGB格式 应该如何设置、初始化解码器呢, 现在我遇到的<em>问题</em>是使用ffmpgeg封装解码插件输出YV12格式 连接微软的AVI decompress filter之后输出到render 无法收到反馈信息 所以希望直接解码输出RGB 试了<em>ffmpeg</em>的swscale函数 似乎有些<em>问题</em>。 多谢回复
【提问】关于 FFMPEG 的问题
各位好,本人初学FFMPEG.rn我将批量图片转换为视频,命令如下:rn<em>ffmpeg</em> -y -s 1600*1200 -i test%d.jpg test.mp4rn请问,一帧就是一幅图片吧?如何控制每秒播放的图片数呢?rn我在test.mp4前加 -r 2 好像就播放了两幅图片就不放了。。。rnrn另外在加入音频后:rn<em>ffmpeg</em> -y -s 1600*1200 -i test%d.jpg -i test.mp3 test.mp4rn视频文件的歌曲高潮部分变得很含糊不清,是我哪弄错了吗?rnrn什么采样率啊,码率啊,比特率,帧速率,弄着弄着就混了。rnrn求前辈给出一个命令,将图片合成视频,每秒播放两张图片之类的,同时有音乐播放,越少失真越好。。。rn走过路过,不要错过。。。rn[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/3.gif][/img]rn
java ffmpeg转换问题
Process p = builder.start();rnp.waitFor();rn我这里已经阻塞了··但视频不能转换下去··去掉p.waitFor就正常了···rnrn我想问一下如果知道视频转换完成了··想要在完成后再做一些别的动作··谢谢大家··
ffmpeg教程的编译问题
[img=https://img-bbs.csdn.net/upload/201409/28/1411875108_532022.png][/img]rn这是我安装编译<em>ffmpeg</em>后的图片,应该是编译成功了,但是在编译教程的时候出现了下面的<em>问题</em>一直不知道怎么解决,求各位好心的人大神帮忙阿:rntutorial01.c:20:32: fatal error: libavcodec/avcodec.h: No such file or directoryrn #include rn ^rncompilation terminated.
在web应用中ffmpeg问题
最近的项目需要用到<em>ffmpeg</em>来进行转换视频文件,奇怪的是当我在一个单独的java文件中测试和在cmd中测试的时候都很快,但是在servlet中调用该转换方法的时候总是有<em>问题</em>:rn 1、转换总是会卡住,除非文件很小就没这<em>问题</em>,但当文件稍微大一点点(几M),转了一小部分之后就卡主了.....rn 2、当我把web服务器(这里我用的是Tomcat)关掉的时候,马上就转过来了。rn所以我想肯定不是转换的过程很久,而是进程死锁的情况吧!rn请问大家如何处理。又遇到类似的<em>问题</em>么?rn希望得到大家的帮助。rn谢谢!rnrn附:转换的方法rnrn[code=Java] public boolean processFlv(String uploadfilename,String newfilename) rn List commend = new java.util.ArrayList(); rn commend.add(FFMPEGPATH); rn commend.add("-i"); rn commend.add(UPLOADPATH+uploadfilename); rn commend.add("-ab");rn commend.add("56");rn commend.add("-ar"); rn commend.add("22050"); rn commend.add("-b"); rn commend.add("500"); rn commend.add("-r"); rn commend.add("15"); rn commend.add("-s"); rn commend.add("320x240"); rn commend.add(CONVERTPATH+newfilename+".flv"); rn try rn ProcessBuilder builder = new ProcessBuilder(); rn builder.command(commend); rn builder.start(); rn return true; rn catch (Exception e) rn e.printStackTrace(); rn return false; rn rn [/code]
ffmpeg av_read_frame() 使用的问题
我有一个视频文件avi格式 yuv420 h.264 rn在调用av_read_frame()的时候.第1304次的时候就小于零了。但是我的bn_frame 有1804 。rn然后我把上面的avi转码成MP4 rn这个时候调用av_read_frame()的时候。第1801次的时候小于零了。这次至少和我的总数相近。为什么会这样。rn我查资料说是到了文件尾部或者出错了。照这个逻辑我的两个测试的次数应该差不多啊。为什么后面的次数反而回大于avi的时候?rn
ffmpeg 播放优酷视频问题
rn2014-10-20 17:17:02.600 MoviePlayer[7408:1408874] [MovieViewController] initializern2014-10-20 17:17:02.600 MoviePlayer[7408:1408874] [MovieViewController] movieViewControllerWithContentPathrn2014-10-20 17:17:02.601 MoviePlayer[7408:1408874] We've got 2 output channelsrn2014-10-20 17:17:02.601 MoviePlayer[7408:1408874] Current sampling rate: 44100.000000rn2014-10-20 17:17:02.602 MoviePlayer[7408:1408874] Current output bytes per sample: 2rn2014-10-20 17:17:02.602 MoviePlayer[7408:1408874] Current output num channels: 2rn2014-10-20 17:17:02.689 MoviePlayer[7408:1408874] [MovieViewController] initWithContentPathrn2014-10-20 17:17:02.690 MoviePlayer[7408:1408874] [MovieViewController] loadViewrn2014-10-20 17:17:04.697 MoviePlayer[7408:1408874] Playing a movie: http://player.youku.com/player.php/sid/XODAwMjkzMDU2/v.swfrn2014-10-20 17:17:05.164 MoviePlayer[7408:1409293] request: GET /player.php/sid/XODAwMjkzMDU2/v.swf HTTP/1.1rnUser-Agent: Lavf/56.9.100rnAccept: */*rnRange: bytes=0-rnConnection: closernHost: player.youku.comrnIcy-MetaData: 1rn2014-10-20 17:17:05.203 MoviePlayer[7408:1409293] header='HTTP/1.1 302 Found'rn2014-10-20 17:17:05.203 MoviePlayer[7408:1409293] http_code=302rn2014-10-20 17:17:05.203 MoviePlayer[7408:1409293] header='X-Powered-By: PHP/5.3.3'rn2014-10-20 17:17:05.203 MoviePlayer[7408:1409293] header='Location: http://static.youku.com/v1.0.0423/v/swf/loader.swf?VideoIDS=XODAwMjkzMDU2&embedid=MTE2LjIzMS44OS4xMTgCMjAwMDczMjY0AgI%3D&wd=&vext=pid%3D%26emb%3DMTE2LjIzMS44OS4xMTgCMjAwMDczMjY0AgI%3D%26bc%3D%26type%3D0'rn2014-10-20 17:17:05.203 MoviePlayer[7408:1409293] header='Content-type: text/html'rn2014-10-20 17:17:05.203 MoviePlayer[7408:1409293] header='Content-Length: 0'rn2014-10-20 17:17:05.204 MoviePlayer[7408:1409293] header='Connection: close'rn2014-10-20 17:17:05.204 MoviePlayer[7408:1409293] header='Date: Mon, 20 Oct 2014 09:17:05 GMT'rn2014-10-20 17:17:05.204 MoviePlayer[7408:1409293] header='Server: LIGHTY_player3'rn2014-10-20 17:17:05.204 MoviePlayer[7408:1409293] header=''rn2014-10-20 17:17:05.222 MoviePlayer[7408:1408874] [MovieViewController] viewDidAppearrn2014-10-20 17:17:05.679 MoviePlayer[7408:1409293] request: GET /v1.0.0423/v/swf/loader.swf?VideoIDS=XODAwMjkzMDU2&embedid=MTE2LjIzMS44OS4xMTgCMjAwMDczMjY0AgI%3D&wd=&vext=pid%3D%26emb%3DMTE2LjIzMS44OS4xMTgCMjAwMDczMjY0AgI%3D%26bc%3D%26type%3D0 HTTP/1.1rnUser-Agent: Lavf/56.9.100rnAccept: */*rnRange: bytes=0-rnConnection: closernHost: static.youku.comrnIcy-MetaData: 1rn2014-10-20 17:17:05.754 MoviePlayer[7408:1409293] header='HTTP/1.1 206 Partial Content'rn2014-10-20 17:17:05.754 MoviePlayer[7408:1409293] http_code=206rn2014-10-20 17:17:05.754 MoviePlayer[7408:1409293] header='Expires: Mon, 20 Oct 2014 17:17:06 GMT'rn2014-10-20 17:17:05.754 MoviePlayer[7408:1409293] header='Cache-Control: max-age=28800'rn2014-10-20 17:17:05.754 MoviePlayer[7408:1409293] header='Content-Type: application/x-shockwave-flash'rn2014-10-20 17:17:05.754 MoviePlayer[7408:1409293] header='Accept-Ranges: bytes'rn2014-10-20 17:17:05.754 MoviePlayer[7408:1409293] header='ETag: "1331592121"'rn2014-10-20 17:17:05.754 MoviePlayer[7408:1409293] header='Last-Modified: Wed, 24 Sep 2014 06:23:00 GMT'rn2014-10-20 17:17:05.755 MoviePlayer[7408:1409293] header='Content-Range: bytes 0-30128/30129'rn2014-10-20 17:17:05.755 MoviePlayer[7408:1409293] header='Content-Length: 30129'rn2014-10-20 17:17:05.755 MoviePlayer[7408:1409293] header='Connection: close'rn2014-10-20 17:17:05.755 MoviePlayer[7408:1409293] header='Date: Mon, 20 Oct 2014 09:17:06 GMT'rn2014-10-20 17:17:05.755 MoviePlayer[7408:1409293] header='Server: staticsz52'rn2014-10-20 17:17:05.755 MoviePlayer[7408:1409293] header=''rn[color=#800000]2014-10-20 17:17:05.756 MoviePlayer[7408:1409293] Format swf probed with size=2048 and score=100rn[color=#800000]2014-10-20 17:17:05.756 MoviePlayer[7408:1409293] SWF compressed file detectedrn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Before avformat_find_stream_info() pos: 4104 bytes read:5438 seeks:0rn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Unknown tag: 69rn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Unknown tag: 77rn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Unknown tag: 65rn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Unknown tag: 9[/color]rn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Unknown tag: 41rn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Unknown tag: 43rn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Unknown tag: 2[/color]rn2014-10-20 17:17:05.844 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.845 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.846 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.847 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.848 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 22rn2014-10-20 17:17:05.849 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.858 MoviePlayer[7408:1409293] st:0 removing common factor 256 from timebasern2014-10-20 17:17:05.858 MoviePlayer[7408:1409293] Unknown tag: 22rn2014-10-20 17:17:05.858 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.858 MoviePlayer[7408:1409293] Unknown tag: 78rn2014-10-20 17:17:05.859 MoviePlayer[7408:1409293] Unknown tag: 2rn2014-10-20 17:17:05.859 MoviePlayer[7408:1409293] Unknown tag: 39rn2014-10-20 17:17:05.859 MoviePlayer[7408:1409293] Unknown tag: 56rn2014-10-20 17:17:05.859 MoviePlayer[7408:1409293] Unknown tag: 82rn2014-10-20 17:17:05.938 MoviePlayer[7408:1409293] After avformat_find_stream_info() pos: 30129 bytes read:30129 seeks:0 frames:1rn2014-10-20 17:17:05.938 MoviePlayer[7408:1409293] Input #0, swf, from 'v.swf':rn2014-10-20 17:17:05.938 MoviePlayer[7408:1409293] Duration: rn2014-10-20 17:17:05.938 MoviePlayer[7408:1409293] N/Arn2014-10-20 17:17:05.938 MoviePlayer[7408:1409293] , bitrate: rn2014-10-20 17:17:05.939 MoviePlayer[7408:1409293] N/Arn2014-10-20 17:17:05.939 MoviePlayer[7408:1409293] Stream #0:0rn2014-10-20 17:17:05.939 MoviePlayer[7408:1409293] , 1, 1/25rn2014-10-20 17:17:05.939 MoviePlayer[7408:1409293] : Video: rawvideo, pal8, 280x13rn2014-10-20 17:17:05.939 MoviePlayer[7408:1409293] , rn2014-10-20 17:17:05.939 MoviePlayer[7408:1409293] 25 tbr, rn2014-10-20 17:17:05.939 MoviePlayer[7408:1409293] 25 tbnrn2014-10-20 17:17:05.939 MoviePlayer[7408:1409293] (rn 0rn)rn
一个神奇的FFMPEG的问题
我在LINUX 下面用FFMPEG 播放一个3GP的文件 在有的分辨率下会没有用(虚拟机的分辨率) 当我切换一下分辨率的时候 或者是在全屏和非全屏之间切换一下也有用
ffmpeg交叉编译问题
大家交叉编译<em>ffmpeg</em>一般选项是什么啊?我是新手,在网上看到的配置一般是:./configure --enable-cross-compile --arch=armv6 --target-os=linux --cross-prefix=arm-linux- --cc=arm-linux--gcc --enable-shared ,make时一直出现rnCC libavcodec/ratecontrol.ornlibavcodec/ratecontrol.c: In function 'get_qscale':rnlibavcodec/ratecontrol.c:344: error: implicit declaration of function '__isnanf'rnlibavcodec/ratecontrol.c:344: error: implicit declaration of function '__isnan',怎么解决啊?谢谢啦!
FFMPEG录制RTMP的问题
<em>问题</em>是这样 。rn我在win下面用<em>ffmpeg</em>做的推流。对应的客户端都是能正常播放的。rn然后再服务器用FFMPEG命令去做RTMP流的录制。rn现在录制出来的文件只有声音。视频是没有。rn然后我试着用Adobe Flash Media Live Encoder 做推流端。视频是可以录制成功的 。rn请问 。<em>ffmpeg</em>做推流要做什么才能正常录制?rn对应的推流命令是<em>ffmpeg</em> -f dshow -i video="USB Camera" -s 320x240 -r 15 -g 75 -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -f flv rtmp://xxxxxxrnrn然后今天误打误撞rn<em>ffmpeg</em> -i ""rtmp://play.xxx live=1" w.flv将RTMP流保存在本地是可以观看的。文件名是live=1 w.flvrn对应 编码格式: Sorenson H263。rn这个是能正常播放的rn若我在命令行里敲 <em>ffmpeg</em> -i "rtmp://play.xxx live=1" w.flv 文件名是w.flvrn对应 编码格式: AVCrn这个是无法播放的。只有声音没事图像rn然后就是一个"的区别这两条命令。rnrn新手请大神们解惑。rn1.这多一个“的区别在哪?rn2.我要如何录制一个可以正藏播放的RTMP流。rn多谢rnrn
ffmpeg链接问题
在c++文件中引用<em>ffmpeg</em>头文件需要加extern “C” extern “C” { #include “libavcodec/avcodec.h” #include “libavformat/avformat.h” #include “libswscale/swscale.h” };
编译ffmpeg问题整理
export TMPDIR=F:/xxx/FFmpeg-master/temp export NDK=D:/android-ndk-r9d-windows-x86_64/android-ndk-r9d export PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt export PLATFORM=$NDK/platform
ffmpeg莫名其妙的问题
AVFormatContext* ifcon =NULL,这里一定要将其设置为NULL,不然会导致一些奇怪的<em>问题</em>出现。
ffmpeg编译时的问题
<em>ffmpeg</em>用cygmin编译时提示 Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in /cygdrive/d/Workspaces/VideoDemo/AndroidManifest.xml 在Application.mk中添加APP_PLATFORM := an
ffmpeg 经常报错问题
在使用<em>ffmpeg</em>经常发生报错 最后发现原因是一定要指定视频的尺寸 不然就会出错
ffmpeg问题及解答
1、编码器打开失败     这是少配置了x264需要的编码参数吧 你把AVCOdecContext的qmin,qmax设置一下 用别的编码器就不一定要设置。     2、avformt_find_stream_info,解决卡住的<em>问题</em>(<em>ffmpeg</em>, demux)      ...........
ffmpeg提取音频问题
<em>ffmpeg</em>来提取视频文件中的音频保存为任意格式,使用命令rn<em>ffmpeg</em> -i video.mpg -f mp3rnaudio_track.mp3/wma/wav/midi/mid/ra/mmf/acc/ogg/rn却显示为:rnUnsupported codec for output stream #0.0 rn生成的mp3文件大小为0请问高手是那里出了<em>问题</em>呢?
基于FFMPEG的视频转换问题
各位大虾,我是新手,想请教一个<em>问题</em>,在mobile smartphone 平台下,基于FFMPEG提供的库做视频转换难度怎么样?能不能以MPEG-4到3GP为例,大概的说一下这个过程吗?
导入ffmpeg 遇到的问题
拖进包含<em>ffmpeg</em> 的库所添加的处理的信息 要在 user head search head 添加头文件 $(PROJECT_DIR)/TWIPCSDK/FFmpeg/include 然后要添加这几个库 libiconv.tbd libz.tbd libbz2.1.0.tbd 这三个库文件 bitcode 要设置为NO10 duplicate symbols for archite
ffmpeg音频wav问题
1、<em>问题</em>: [wav @ 0xxxxxxxx] Filesize 4550172774 invalid for wav, output file will be broken 2、原因: 音频处理程序默认不兼容超过4G的音频文件 3、解决办法: 在 <em>ffmpeg</em> 的命令中加入 -rf64 auto...
ffmpeg for android 编译问题
求教rn<em>ffmpeg</em>2.1 然后 android-ndk-r9crn编译的时候,没有生成的共享库到所说的目录里rn教程是这个rnhttp://www.roman10.net/how-to-build-<em>ffmpeg</em>-with-ndk-r9/rnrnbuild_android.sh修改如下rnrn////////////////////////////////////////////////////////rnNDK=$HOME/android-ndk-r9crnSYSROOT=$NDK/platforms/android-9/arch-arm/rnTOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86rnrnfunction build_onernrn./configure \rn --prefix=$PREFIX \rn --enable-shared \rn --disable-static \rn --disable-doc \rn --disable-<em>ffmpeg</em> \rn --disable-ffplay \rn --disable-ffprobe \rn --disable-ffserver \rn --disable-avdevice \rn --disable-doc \rn --disable-symver \rn --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \rn --target-os=linux \rn --arch=arm \rn --enable-cross-compile \rn --sysroot=$SYSROOT \rn --extra-cflags="-Os -fpic $ADDI_CFLAGS" \rn --extra-ldflags="$ADDI_LDFLAGS" \rn $ADDITIONAL_CONFIGURE_FLAGrnmake cleanrnmakernrnCPU=armrnPREFIX=$(pwd)/android/$CPU rnADDI_CFLAGS="-marm"rnbuild_onernrn////////////////////////////////////////////////////////
ffmpeg 在windows 下使用问题
高手指教从哪开始学习,<em>ffmpeg</em>,相关链接也行,非常感谢!!
ffmpeg 开发问题
想问下下关于用<em>ffmpeg</em>做视频处理方面的东西 现在想做些视频裁剪和缩放的工作 不知道调库函数该怎么做rnrn就比如:<em>ffmpeg</em> -y -i test.mpeg -bitexact -vcodec h263 -b 128 -r 15 -s 176x144 -acodec aac -ac 2 -ar 22500 -ab 24 -f 3gp test.3gp 用命令行可以这样实现 rn rn但是想用<em>ffmpeg</em>的库函数实现 这些参数有没有接口在哪里改? 不知道大家知道嘛???rnrnrn还有能不能用库函数如何调用AVS脚本的接口。rnrn谢谢
ffmpeg configure 问题
#./configure --enable-cross-compile --target-os=linux --cross-prefix=arm-linux- --cc=arm-linux-gcc --enable-shared --arch=armv6 --enable-gpl --enable-libx264 --enable-pthreads --prefix=/opt/EmbedSky/4.3.3/arm-linux --extra-libs=-lpthread --extra-cflags=-I/opt/EmbedSky/4.3.3/arm-linux/include --extra-ldflags=-L/opt/EmbedSky/4.3.3/arm-linux/lib/rnrnrn结果出现:rnWARNING: arm-linux-pkg-config not found, library detection may fail.rn紧急求助高手!!!!!如何解决????????
关于ffmpeg编译的问题
我想在我的Qt程序里用<em>ffmpeg</em>播放yuv文件,rn我用的是qt-opensource-windows-x86-mingw482_opengl-5.3.2,也就是用的mingw编译器,rn那我该怎么在windows中编译<em>ffmpeg</em>源文件呢?
ffmpeg编码h264的问题
我用佰锐的<em>ffmpeg</em>SDK试了下 output_example.c编码h264,结果帧率这些都不对了。rn发现从guess_format()得到的AVOutputFormat* 里面write_header函数指针是空的,那么开始写文件时的头信息av_write_header函数里面也不会正确,不知道是不是这个引起的?rnrn怎么解决呢?求助~
关于现在的ffmpeg问题
现在正在学习 .net中上传视频并转换成.flv格式,地址如下http://www.csharpwin.com/dotnetspace/9592r7935.shtmlrn我想问文中所使用的<em>ffmpeg</em>是经过MinGW+msys处理之后的 还是从<em>ffmpeg</em>官网下载后就直接可用的rn由于找到的多数是09 10年的帖子 不知道现在13年 如果我想在VS2008中调用<em>ffmpeg</em>的方法还是原来的方法吗 不知道有没有最近接触这一方面的大神能够指点我一下
FFMPEG AAC 音频解码问题
我这边使用<em>ffmpeg</em>0.11 中avcodec_decode_audio4 去解码AAC LATM 的音频数据,偶尔出现解码后AVFrame 中data[0](PCM 数据)全为0, 但是函数的返回值,包括got_frame 参数返回值显示都是正常的:rn具体代码如下:rnrn int ret, len, data_size,planar, ch ,plane_size;rn AVFrame frame;rn int got_frame;rn AVPacket i_packet;rn int decode_times;rn int flush_complete;rn PrivAVFrame *i_privframe, *dst_privframe;rn rn if(frames == NULL || packet == NULL)rn return -1;rn len = 0;rn decode_times = 0;rn flush_complete = 0;rn while(packet->data_size > 0)rn rn //frame default valuern avcodec_get_frame_defaults(&frame);rnrn if(flush_complete)rn break;rn av_init_packet(&i_packet);rn i_packet.data = packet->data;rn i_packet.size = packet->data_size;rn#if 0rn if(mCodecContext->get_buffer != avcodec_default_get_buffer)rn rn mCodecContext->get_buffer = avcodec_default_get_buffer;rn mCodecContext->release_buffer = avcodec_default_release_buffer;rn rn#endifrn len = avcodec_decode_audio4(mCodecContext, &frame, &got_frame, &i_packet);rn if(len < 0)rn rn OS_log(LVL_ERR, 0, "Decoding audio error");rn av_free_packet(&i_packet);rn frames->data_size = 0;rn return -1;rn rnrn packet->data += len;rn packet->data_size -= len;rn#if 1rn LOGV("ret (%d), size(%d), got_frame(%d)",len, i_packet.size, got_frame);rn#endifrn if(!got_frame)rn rn if(!i_packet.data && mCodecContext->codec->capabilities & CODEC_CAP_DELAY)rn flush_complete = 1;rn frames->data_size = 0;rn continue;rn rn#if 0rn planar = av_sample_fmt_is_planar(mCodecContext->sample_fmt);rn data_size = av_samples_get_buffer_size(&plane_size, rn mCodecContext->channels,rn frame.nb_samples,rn mCodecContext->sample_fmt, 1);rn#elsern data_size = av_samples_get_buffer_size(NULL, rn mCodecContext->channels,rn frame.nb_samples,rn mCodecContext->sample_fmt, 1);rn#endifrnrn rn if(decode_times == 0)rn rn privav_init_frame(frames);rn if(frames->data == NULL)rn rn ret = privav_new_frame(frames, data_size);rn if(ret < 0)rn return -1;rn rn elsern rn if(frames->data_size < data_size)rn rn OS_log(LVL_ERR,0,"Output buffer is not enough long(%d < %d)",frames->data_size, data_size);rn return -1;rn rn rn rn dst_privframe = frames;rn rn elsern rn i_privframe = (PrivAVFrame *)malloc(sizeof(PrivAVFrame));rn if(i_privframe)rn rn ret = privav_new_frame(i_privframe, data_size);rn if(ret < 0)rn rn free(i_privframe);rn i_privframe = NULL;rn return -1;rn rn i_privframe->alloc_flag = 1;rn dst_privframe->next = i_privframe;rn rn dst_privframe = dst_privframe->next;rn rn elsern rn //give up the last frames;rn break;rn rn rn rn#if 1rn[color=#FF0000] LOGV("frame size (%d), 0x%x, 0x%x", data_size, frame.data[0][0], frame.data[0][1]);rn if(frame.data[0][0] == 0x00 && frame.data[0][1] == 0x00 &&frame.data[0][20] == 0x00&&frame.data[0][21] == 0x00 )rn rn //free(dst_privframe);rn LOGE("AUDIO is 00, reopen the decoder");rn if(mCodecContext)rn rn avcodec_close(mCodecContext);rn if(avcodec_open2(mCodecContext, mCodec,NULL) < 0)rn rn LOGE("open decoder error");rn rn LOGV("DECODER channels(%d), sample-rate(%d), sample-fmt(%d)",rn mCodecContext->channels,mCodecContext->sample_rate, mCodecContext->sample_fmt);rn rn [/color]rn#endifrn#if 0rn //data copyingrn memcpy(dst_privframe->data, frame.extended_data[0], plane_size);rn if(planar && mCodecContext->channels > 1)rn rn uint8_t *out = dst_privframe->data + plane_size;rn for(ch = 1; ch < mCodecContext->channels; ch++)rn rn memcpy(out, frame.extended_data[ch], plane_size);rn out += plane_size;rn rn rn#elsern memcpy(dst_privframe->data, frame.data[0], data_size);rn#endifrn if(packet->pts > 0)rn rn audio_clock = packet->pts;rn packet->pts = -1;rn rn dst_privframe->pts = audio_clock;rn //frames->pos= packet->pos;rn dst_privframe->key_frame = frame.key_frame;rn //reset the actual size of datarn dst_privframe->data_size = data_size;rn audio_clock += data_size/rn (mCodecContext->channels * mCodecContext->sample_rate *av_get_bytes_per_sample(mCodecContext->sample_fmt));rnrn decode_times++;rnrn //first frame is decodedrn //return len;rn break;rn rn return len;rnrnrn中间红色部分 显示输出结果,为全0, 后面的解码也全都为0,导致整个视频后面没有声音。rn这个<em>问题</em>困扰了我几天,希望大神们可以帮忙回答,谢谢!
使用ffmpeg播放视频的问题
使用<em>ffmpeg</em>播放视频 是不是一定要SDL的配合才能播放声音 以及音频视频的同步播放?rnrn我现在直接用av_read_frame 读取 然后解码显示 可是这样好像没法知道要多久显示下一帧才合适 导致视频播放很快。rnrn网上找到的教程都是要SDL的配合使用rn还要创建另外一个线程来读取视频,感觉这样太麻烦了 不知道有没有更简单的方法?rn就是不用SDL 能否使视频按正常速度播放?rnrn求大神指点rn谢了! rn
ffmpeg 程序编译问题
rn环境ubuntu11.10rn最新<em>ffmpeg</em>代码rnsvn co svn://svn.mplayerhq.hu/<em>ffmpeg</em>/trunk <em>ffmpeg</em>rn./configure --enable-shared --enable-pthreads --disable-yasmrnmake && make installrn安装了zlib1g-dev,libbz2-devrn编译测试程序:rn[code=c]rn#include "libavformat/avformat.h"rn#include "libavcodec/avcodec.h"rn#include "libavutil/avutil.h"rn#include "stdio.h"rnint main(int argc, char* argv[])rnrn printf("going to av_register_all\n");rn av_register_all();rn return 0;rnrn rn[/code]rnrngcc -o <em>ffmpeg</em>_test ./<em>ffmpeg</em>_test.c -lavformat -lavcodec -lavutil -lz -lm -lpthread -lbz2rnrn出现大量未定义错误,如下:rn /usr/local/lib/libavcodec.a(alsdec.o): In function `decode_frame':rn/home/cv/code_bank/<em>ffmpeg</em>/libavcodec/alsdec.c:1453: undefined reference to `av_get_bits_per_sample_fmt'rn/usr/local/lib/libavcodec.a(alsdec.o): In function `decode_init':rn/home/cv/code_bank/<em>ffmpeg</em>/libavcodec/alsdec.c:1716: undefined reference to `av_get_bits_per_sample_fmt'rn/usr/local/lib/libavcodec.a(bink.o): In function `decode_init':rn...rncollect2: ld 返回 1rnrn请问有哪位兄弟知道是怎么回事?rn怎么解决?rnrn谢谢!rnrnrn
FFMpeg编码解码问题
现在我读取一个H264编码的视频文件,通过av_read_frame读取到AVPacket,然后再通过avcodec_send_packet和 avcodec_receive_frame转成AVFrame,然后再通过avcodec_send_frame和avcodec_receive_packet转成AVPacket再通过av_interleaved_write_frame进行rtmp发送就不行,如果直接从文件通过av_read_frame读取的AVPacket直接发送就可以。我的代码在这:https://bbs.csdn.net/topics/392501016
ffmpeg 在wince下编译 问题
我按照网上写的 采用cygwin 交叉编译的方法 编译<em>ffmpeg</em> rnrn但是 在。/configure 后 就出现 rnrnarm-wince-mingw32ce-gcc is unable to create an executable file. rnC compiler test failed. rnrn这个错误,高手请指点一下。 rnrn哪位高手有 wince下编译好的lib和dll 偶也不用编译啦
FFmpeg解码问题
网罗了很多资源,都是利用FFmpeg针对视频文件进行解码的操作,有没有办法对流直接解码为视频帧呢?rn比如这样:rnrn[code=csharp]rndecoder.H264Decode(byte[] framedata, byte[] out outdata);rnrn[/code]rnrn(就是输入一帧的数据,直接取得解码后的数据,再使用BitmapData形成图像的方法)
ffmpeg解码时间戳的问题
我的目标是对一个任意格式视频进行解码,在解码的过程中能得到每帧的正确时间,相对于视频开始到结束。rnfloat video_timebase = av_q2d(pFormatContext->stream[ivideo_stream_index]->time_base);rnCurrentTime= packet.pts* video_timebase;rn其中packet是当前解码的视频数据包,rn部分视频能得到正确的时间,有部分视频的时间就乱七八糟,请问这是什么原因
关于ffmpeg编解码问题
/*******************************************************************************************/rnint test1(JNIEnv* env,jstring str)rnrn AVFormatContext *pFormatCtx;rn int i, videoStream;rn AVCodecContext *pCodecCtx;rn AVCodec *pCodec;rn AVFrame *pFrame;rn AVFrame *pFrameRGB;rn AVPacket packet;rn int frameFinished;rn int numBytes;rn uint8_t *buffer;rn struct SwsContext *img_convert_ctx;rn int stream_index;rn jbyte* stream_index_byte;rn jbyte* videostream;rn av_register_all();rn avformat_network_init();rn int open_url_error_flag;rn int stream_info;rn int open_codec_error ;rn const jbyte* url ;rn if(str == NULL)rn return -1;rn url = (*env)->GetStringUTFChars(env,str,NULL);rn if(url == NULL)//转换路径有可能返回位nullrn return -1;rn LOGE("test url %s",url);rn open_url_error_flag = avformat_open_input(&pFormatCtx,url,NULL,NULL);rn if(open_url_error_flag < 0)rn return -1;rn LOGE("open url error flag = %d",open_url_error_flag);rn stream_info = avformat_find_stream_info(pFormatCtx,NULL);rn LOGE("find stream info = %d",stream_info);rn if(stream_infostreams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)rn rn videoStream=i;rn break;rn rn rn if(videoStream==-1)rn return -1; // Didn't find a video streamrnrn // Get a pointer to the codec context for the video streamrn // 得到视频流编码的上下文指针rn pCodecCtx=pFormatCtx->streams[videoStream]->codec;rnrn // construct the scale context, conversing to PIX_FMT_RGB24rn // 根据编码信息设置渲染格式rn img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt,rn pCodecCtx->width, pCodecCtx->height, PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL);rn if(img_convert_ctx == NULL)rn rn fprintf(stderr, "Cannot initialize the conversion context!\n");rn// exit(1);rn return -1;rn rnrn // Find the decoder for the video streamrn // 在库里面查找支持该格式的解码器rn pCodec=avcodec_find_decoder(pCodecCtx->codec_id);rn if(pCodec==NULL)rn rn fprintf(stderr, "Unsupported codec!\n");rn return -1; // Codec not foundrn rn // Open codecrn // 打开解码器rn if(avcodec_open2(pCodecCtx, pCodec,NULL)width, pCodecCtx->height);rn buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); // buffer = new uint8_t[numBytes];rnrn // Assign appropriate parts of buffer to image planes in pFrameRGBrn // Note that pFrameRGB is an AVFrame, but AVFrame is a supersetrn // of AVPicturern // 给pFrameRGB帧附加上分配的内存rn avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24, pCodecCtx->width, pCodecCtx->height);rnrn // Read frames and save first five frames to diskrn i=0;rn while(av_read_frame(pFormatCtx, &packet)>=0) // 读取一个帧rn rn LOGE("packet.stream_index = %d",packet.stream_index);rn LOGE("videoStream = %d",videoStream);rn// stream_index_byte = intToByte(packet.stream_index);rn // Is this a packet from the video stream?rn if(packet.stream_index==videoStream)rn rn // Decode video framern // 解码该帧rn avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);rn // Did we get a video frame?rn if(frameFinished)rn rn // Convert the image from its native format to RGBrn // img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24,rn // (AVPicture*)pFrame, pCodecCtx->pix_fmt, pCodecCtx->width,rn // pCodecCtx->height);rnrn // 把该帧转换成rgbrnrn // 如果只提取关键帧,加上这句rn // if (pFrame->key_frame == 1)rn sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);rn // Save the frame to diskrn // 保存前5帧rn if(++idata[0], pCodecCtx->width, pCodecCtx->height, 24);rn SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i);rn rn rn rnrn // Free the packet that was allocated by av_read_framern // 释放读取的帧内存rn av_free_packet(&packet);rn rnrn // Free the RGB imagern av_free(buffer);rn av_free(pFrameRGB);rnrn // Free the YUV framern av_free(pFrame);rnrn // Close the codecrn avcodec_close(pCodecCtx);rnrn // Close the video filern av_close_input_file(pFormatCtx);rnrn return 0;rnrnrn这是我从网上拷贝的代码,然后改了一些方法,因为我用的是2.0的所以有些方法改变了,现在有一个<em>问题</em>就是 packet.stream_index==videoStream他们的值不一致,packet.stream_index 一直是一个7位数,我不清楚这是为啥。。是字节序的原因么?
ffmpeg swscale问题
我用<em>ffmpeg</em> + framebuffer 写了个显示视频的东东。。。现在想问各位大虾一下关于视频缩放的<em>问题</em>。。。就是如果我要进行视 频缩放应该怎么办。。。我知道swscale可以实现解码帧的缩放<em>问题</em>。。但是不知道怎么用。。希望高人指点下。。感激不尽 。代码如下:rn[code=C/C++]#include rn#include rn#include rnrn#include rn#include rn#include rnrn#include rn#include rn#include rn#include rn#include rnrn#include rn#include rn#include rn#include rnrnrnchar *fb_dev_name = NULL;rnstatic int fb_dev_fd;rnstatic int fb_tty_fd = -1;rnstatic size_t fb_size;rnstatic uint8_t *frame_buffer;rnstatic uint8_t *center;rnstatic struct fb_fix_screeninfo fb_finfo;rnstatic struct fb_var_screeninfo fb_orig_vinfo;rnstatic struct fb_var_screeninfo fb_vinfo;rnrnstatic int fb_line_len;rnstatic char *fbp = 0;rnstatic int xres = 400;rnstatic int yres = 240;rnstatic int bits_per_pixel = 0;rnstatic long int screenSize = 0;rnrnrnstatic void fb_init(void);rnstatic void fb_uninit(void);rnrnstatic void ShowFrame(AVFrame *pFrame, int width, int height);rnstatic inline void *memcpy_pic2(void *dst, const void *src,rn int bytesPerLine, int height,rn int dstStride,int srcStride,int limit2width);rnrnint main (int argc, const char * argv[])rnrn AVFormatContext *pFormatCtx;rn int i, videoStream;rn AVCodecContext *pCodecCtx;rn AVCodec *pCodec;rn AVFrame *pFrame; rn AVFrame *pFrameRGB;rn AVPacket packet;rn int frameFinished;rn int numBytes;rn uint8_t *buffer;rnrn fb_init();rn // Register all formats and codecsrn av_register_all();rnrn // Open video filern if(av_open_input_file(&pFormatCtx, argv[1], NULL, 0, NULL)!=0)rn return -1; // Couldn't open filernrn // Retrieve stream informationrn if(av_find_stream_info(pFormatCtx)streams[videoStream]->codec;rnrn // Find the decoder for the video streamrn pCodec=avcodec_find_decoder(pCodecCtx->codec_id);rn if(pCodec==NULL)rn return -1; // Codec not foundrnrn // Open codecrn if(avcodec_open(pCodecCtx, pCodec)time_base.num>1000 && pCodecCtx->time_base.den==1)rn pCodecCtx->time_base.den=1000;rn rn // Allocate video framern pFrame=avcodec_alloc_frame();rnrn // Allocate an AVFrame structurern pFrameRGB=avcodec_alloc_frame();rn if(pFrameRGB==NULL)rn return -1;rnrn // Determine required buffer size and allocate bufferrn numBytes=avpicture_get_size(PIX_FMT_RGB565, pCodecCtx->width,rn pCodecCtx->height);rnrn buffer=malloc(numBytes);rnrn // Assign appropriate parts of buffer to image planes in pFrameRGBrn avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB565,rn pCodecCtx->width, pCodecCtx->height);rnrn // Read frames and save first five frames to diskrn i=0;rn while(av_read_frame(pFormatCtx, &packet)>=0)rn rn // Is this a packet from the video stream?rn if(packet.stream_index==videoStream)rn rn // Decode video framern // avcodec_decode_video(pCodecCtx, pFrame, &frameFinished, rn // packet.data, packet.size);rn avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, rn &packet);rnrn // Did we get a video frame?rn if(frameFinished)rn rn static struct SwsContext *img_convert_ctx;rnrn#if 0rn // Older removed codern // Convert the image from its native format to RGB swscalern img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24, rn (AVPicture*)pFrame, pCodecCtx->pix_fmt, pCodecCtx->width, rn pCodecCtx->height);rn rn // function template, for referencern int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,rn int srcSliceH, uint8_t* dst[], int dstStride[]);rn#endifrn // Convert the image into YUV format that SDL usesrn if(img_convert_ctx == NULL) rn int w = pCodecCtx->width;rn int h = pCodecCtx->height;rn rn img_convert_ctx = sws_getContext(w, h, rn pCodecCtx->pix_fmt, rn w, h, PIX_FMT_RGB565,SWS_FAST_BILINEAR,// SWS_BICUBIC,rn NULL, NULL, NULL);//我想在这里通过修改后两个w,h变量实现缩放。。但是效果不行。。会变成双屏显示 :(rn if(img_convert_ctx == NULL) rn fprintf(stderr, "Cannot initialize the conversion context!\n");rn exit(1);rn rn rn int ret = sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0, rn pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);rn // int ret = sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0, rn // 240, pFrameRGB->data, pFrameRGB->linesize);rn#if 0 // this use to be true, as of 1/2009, but apparently it is no longer true in 3/2009rn if(ret) rn fprintf(stderr, "SWS_Scale failed [%d]!\n", ret);rn exit(-1);rn rn#endifrn // Save the frame to diskrn // if(i++width, pCodecCtx->height);rn // printf("the linesize is %d the fb_line_len is %d\n",pFrame->linesize[0],fb_line_len);rn ShowFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height);rn // ShowFrame(pFrameRGB, 400, 240);rn rn //int y;rn // for(y=0; y< pCodecCtx->height; y++)rn // write(fb_dev_fd,pFrameRGB->data[0] + y*pFrameRGB->linesize[0],pCodecCtx->width*2);rn #if 1rn //if(write(fb_dev_fd, (void *)buffer, numBytes) == -1)rn // rn // printf ("fb write date error.\n");rn // perror ("fb write");rn // usleep (40000);rn // rn // memcpy(center, (void *)buffer,numBytes); rn #endif rn rn rnrn // Free the packet that was allocated by av_read_framern av_free_packet(&packet);rn rnrn // Free the RGB imagern free(buffer);rn av_free(pFrameRGB);rnrn // Free the YUV framern av_free(pFrame);rnrn // Close the codecrn avcodec_close(pCodecCtx);rnrn // Close the video filern av_close_input_file(pFormatCtx);rnrn fb_uninit();rnrn // return 0;rnrnrnrnstatic void fb_init()rnrnrn if(!(fb_dev_name = getenv("FRAMEBUFFER")))rn fb_dev_name = strdup("/dev/fb0");rn rn #if 1rn if(-1 == (fb_dev_fd = open(fb_dev_name, O_RDWR)))rnrn printf("Can't open %s:%s\n",fb_dev_name,strerror(errno));rn exit(1);rnrn rn#endifrn rn if(ioctl(fb_dev_fd,FBIOGET_VSCREENINFO,&fb_vinfo))rnrn printf("Can't get VSCREENINFO:%s\n",strerror(errno));rn exit(2);rnrn rn rn if(ioctl(fb_dev_fd,FBIOGET_FSCREENINFO, &fb_finfo))rnrn printf("Error : reading fixed information.\n");rn exit(3);rnrn rn fb_orig_vinfo = fb_vinfo;rn printf("%dx%d, %dbpp\n", fb_vinfo.xres, fb_vinfo.yres, fb_vinfo.bits_per_pixel );rn xres = fb_vinfo.xres;rn yres = fb_vinfo.yres;rn bits_per_pixel = fb_vinfo.bits_per_pixel;rnrn//计算屏幕的总大小(字节)rn screenSize = fb_vinfo.xres * fb_vinfo.yres * fb_vinfo.bits_per_pixel / 8;rn // screenSize = fb_vinfo.xres * fb_vinfo.yres;rn printf("screensize=%d\n",screenSize);rnrn//内存映射rn frame_buffer = mmap(0, screenSize, PROT_READ | PROT_WRITE, MAP_SHARED, fb_dev_fd, 0);rn if ((int)fbp == -1)rn rn printf("Error: failed to map framebuffer device to memory.\n");rn exit(4);rn rn rn fb_line_len = fb_finfo.line_length;rn fb_size = fb_finfo.smem_len;rn center = frame_buffer ;// use for double buffer in futurern rnrnrnrnstatic void fb_uninit()rnrn munmap(fbp, screenSize);rn close(fb_dev_fd);rn return 0;rnrnrn#if 1rnstatic inline void* memcpy_pic2(void *dst, const void *src,rn int bytesPerLine, int height,rn int dstStride,int srcStride,int limit2width)rnrn int i;rn void *retval = dst;rnrn #if 0rn if(!limit2width && dstStride == srcStride)rn rn if(srcStride < 0)rn src = (uint8_t*)src + (height - 1)*srcStride;rn dst = (uint8_t*)dst + (height -1 )*dstStride;rn srcStride =- srcStride;rn rn memcpy(dst,src,srcStride*height);rn elsern #endifrn for(i= 0 ; i < height ; i++)rn rn memcpy(dst, src, bytesPerLine); rn src = (uint8_t*)src + srcStride;rn dst = (uint8_t*)dst + dstStride;rn rn rn // rn rnrn return retval;rnrnrnrn#endifrnrn#if 1rnstatic void ShowFrame(AVFrame *pFrame, int width, int height)rnrnrnrn uint8_t *d;rn rn d = center+fb_line_len*150+fb_vinfo.bits_per_pixel / 8*200; //+ fb_line_len * y + fb_pixel_size * x;rn memcpy_pic2(d, pFrame->data[0], width*2, height, fb_line_len,pFrame->linesize[0],0);rnrnrnrnrn#endif[/code]rn
FFMPEG之调用avcodec_open2的问题
[code=c]rn av_register_all();rn if (avformat_alloc_output_context2(&ofmtctx, NULL, NULL, (const char*)argv[1]) < 0)rn rn printf("Could not open file [%s]\n", argv[1]);rn goto end1;rn rn if (!(ofmtctx->oformat->flags & AVFMT_NOFILE))rn rn sprintf_s(url, "file:%s", argv[1]);rn if (ret = avio_open(&ofmtctx->pb, url, AVIO_FLAG_WRITE) < 0)rn rn av_strerror(ret, errbuf, 256);rn printf("Could not open avio[%s]\n", errbuf);rn goto end1;rn rn rn if (!(ostream_v = avformat_new_stream(ofmtctx, NULL)))rn rn printf("Could not create stream\n");rn goto end1;rn rn if (!(ocodec = avcodec_find_encoder(ofmtctx->oformat->video_codec)))rn rn printf("Could not find encoder %s\n", avcodec_get_name(AV_CODEC_ID_H264));rn goto end1;rn rn if ((ret = avcodec_open2(ostream_v->codec, ocodec, NULL)) < 0)rn rn av_strerror(ret, errbuf, 256);rn printf("Could not open encoder[%s]\n", errbuf);rn goto end1;rn rn[/code]rn运行到if ((ret = avcodec_open2(ostream_v->codec, ocodec, NULL)) < 0) ret = -22,非常的费解。我用的是<em>ffmpeg</em>3.0.1。在https://<em>ffmpeg</em>.zeranoe.com/blog/下载的。
各位关于ffmpeg问题
请问各位大虾 <em>ffmpeg</em> 是否可以检测文件的编码格式 例如 是否可以检测出一个mp4文件是h264编码的
关于FFmpeg的问题
今天遇到一个棘手的<em>问题</em> :rn Building <em>ffmpeg</em> in GCC x86_64 Release config...rn1> Configuring...rn1>EXEC : error : speex not found using pkg-configrn1> rn1> If you think configure made a mistake, make sure you are using the latestrn1> version from Git. If the latest version fails, report the problem to thern1> <em>ffmpeg</em>-user@<em>ffmpeg</em>.org mailing list or IRC #<em>ffmpeg</em> on irc.freenode.net.rn1> Include the log file "config.log" produced by configure as this will helprn1> solve the problem.rn1> rn1> ------------------------------rn1> [ERROR] 'sh build_<em>ffmpeg</em>.sh x64 Build' failed! rn1> ------------------------------ rnrn<em>ffmpeg</em>在config的时候出现这样的<em>问题</em> speex.a,speex.al 和pkg-config都已经安装好了 但是还是一直在弹这个错误。rnrn如何解决这个<em>问题</em> 急死人 rnconfig.log显示是如下 :rnx86_64-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -DPIC -D_WIN32_WINNT=0x0502 -DWINVER=0x0502 -I../../thirdparty/include -std=c99 -fomit-frame-pointer -c -o /tmp/ffconf.aXafPnQz.o /tmp/ffconf.PamfaQPF.crnx86_64-w64-mingw32-gcc -L../../thirdparty/lib64 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--as-needed -o /tmp/ffconf.OTwUSTBR.exe /tmp/ffconf.aXafPnQz.o -lopencore-amrwb -lopencore-amrnb -lm -lbz2 -lz -lpsapi -ladvapi32 -lshell32rncheck_pkg_config speex speex/speex.h speex_decoder_init -lspeexrnfalse --exists --print-errors speexrnERROR: speex not found using pkg-configrn谁搞过这个 求指导 rn好像speex和pkg-config有什么关联的 ~唉头疼
集成FFmpeg的问题
项目需求今天加了一个在线播放flv格式的视频,但是苹果只支持h264编码的格式,MP4是一个,如果需要播放flv的需要转码,就用到了FFmpeg,据说这个东西可以把市场上所有的格式都能转换,网上查了很多, 都是讲配置FFmpeg,基本上没有使用的教程, 大家可以参考以下网址进行配置  http://blog.sina.com.cn/s/blog_47522f7f0102vbwp.html 但是
FFMpeg 编码解码问题
extern "C"rnrn#include rn//引入头文件rn#include rn//引入时间rn#include rn#include rn#include rnrnrnint avError(int errNum) rn char buf[1024];rn av_strerror(errNum, buf, sizeof(buf));rn printf("%s\n",buf);rn return -1;rnrnrnint main()rnrn av_register_all();rn avformat_network_init();rn const char *inUrl = "drj.flv";rn AVFormatContext *pInputCtx = NULL;rn int ret = avformat_open_input(&pInputCtx, inUrl, 0, NULL);rn if (ret < 0)rn return avError(ret);rn rn ret = avformat_find_stream_info(pInputCtx, 0);rn if (ret != 0)rn return avError(ret);rn rn av_dump_format(pInputCtx, 0, inUrl, 0);rn AVFormatContext * pOutputCtx = NULL;rn ret = avformat_alloc_output_context2(&pOutputCtx, NULL, "flv", "rtmp://192.168.1.9/live/demo3");rn if (ret < 0)rn return avError(ret);rn rn int vStream = -1;rn for (int i = 0; i < pInputCtx->nb_streams; i++)rn AVStream *out = avformat_new_stream(pOutputCtx, pInputCtx->streams[i]->codec->codec);rn if (!out)rn return avError(0);rn rnrn if(pInputCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)rn vStream=i;rn rn ret = avcodec_parameters_copy(out->codecpar, pInputCtx->streams[i]->codecpar);rn if (ret < 0)rn return avError(ret);rn rn out->codec->codec_tag = 0;rn rn if(vStream==-1)rn return -1; // Didn't find a video streamrn rn AVCodecContext*pDecodecCtx=pInputCtx->streams[vStream]->codec;rn AVCodec*pDeodec=avcodec_find_decoder(pDecodecCtx->codec_id);rn if(pDeodec==NULL)rn return -1; // Codec not foundrn rn if(avcodec_open2(pDecodecCtx, pDeodec, 0)pb, "rtmp://192.168.1.9/live/demo3", AVIO_FLAG_WRITE);rn if (ret < 0)rn avError(ret);rn rn ret = avformat_write_header(pOutputCtx, 0);rn if (ret < 0)rn avError(ret);rn rn // Allocate an AVFrame structurern AVFrame*pFrame264=av_frame_alloc();rn if(pFrame264==NULL)rn return -1;rn rnrn AVCodec *pEncodec = avcodec_find_encoder(AV_CODEC_ID_H264);rn if (!pEncodec)rn fprintf(stderr, "Codec not found\n");rn return -1;rn rnrn AVCodecContext *pEncodecCtx = avcodec_alloc_context3(pEncodec);rn if (!pEncodecCtx)rn fprintf(stderr, "Codec not found\n");rn return -1;rn rn pEncodecCtx->bit_rate = pDecodecCtx->bit_rate;// put sample parametersrn pEncodecCtx->width =1280;//rn pEncodecCtx->height = 550;//rn pEncodecCtx->time_base.num = 1;//(AVRational)1,25;rn pEncodecCtx->time_base.den = 25;rn pEncodecCtx->gop_size = 250; // emit one intra frame every ten framesrn pEncodecCtx->max_b_frames=1;rn pEncodecCtx->qmin = 10;rn pEncodecCtx->qmax = 51;rn pEncodecCtx->thread_count = 1;rn pEncodecCtx->codec_id = AV_CODEC_ID_H264;rn pEncodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;rn pEncodecCtx->pix_fmt = pDecodecCtx->pix_fmt;//PIX_FMT_RGB24;rnrn if (pOutputCtx->oformat->flags & AVFMT_GLOBALHEADER)rn rn pEncodecCtx->flags |= AV_CODEC_FLAG_QSCALE;rn rnrn // Open codecrn AVDictionary *param = 0;rn av_dict_set(&param, "preset", "fast", 0);rn av_dict_set(&param, "tune", "zerolatency", 0);rn if(avcodec_open2(pEncodecCtx, pEncodec, &param)< 0)rn break;rn rn if(avPacket.stream_index == vStream)rn rn //从此开始,如果把下面代码去掉,直接 av_interleaved_write_frame(pOutputCtx, &avPacket)就没有任何<em>问题</em>,但如果加上就有<em>问题</em>。rn avcodec_send_packet(pDecodecCtx, &avPacket);rn avcodec_receive_frame(pDecodecCtx,pFrame264);rn av_init_packet(&avOutPacket);rn avOutPacket.data = NULL;rn avOutPacket.size = 0;rn nRet = avcodec_send_frame(pEncodecCtx,pFrame264);rn if (nRet < 0)rn fprintf(stderr, "avcodec_send_frame - 2 failed [%d]!\n", AVERROR(nRet));rn avError(nRet);rn return -7;rn rn nRet = avcodec_receive_packet(pEncodecCtx,&avOutPacket);rn if (nRet < 0)rn fprintf(stderr, "avcodec_receive_packet failed [%d]!\n", nRet);rn avError(nRet);rn return -7;rn rn //到此为止rnrn nRet = av_interleaved_write_frame(pOutputCtx, &avOutPacket);rn if (nRet < 0)rn fprintf(stderr, "av_interleaved_write_frame failed [%d]!\n", nRet);rn avError(nRet);rn break;rn rn rn elsern nRet = av_interleaved_write_frame(pOutputCtx, &avPacket);rn if (nRet < 0)rn break;rn rn rn rn return 0;rnrnrnrn大神们,上面是我的代码,如果去掉注释的那几行代码,直接写入到rtmp read出来的AVPacket是正常播放,但如果加上那几行发送解码之后再编码的AVPacket就不行,我这显示的<em>问题</em>是avcodec_receive_packet那个函数返回-11,提示错误Resource temporarily unavailable。
ffmpeg 线程 decode 问题
有人遇到过吗,我在另一个线程 avcodec_decode_video 结果第一帧检测出来是 B 帧,事实上应该是 I 帧,造成后面的都花屏了。rnrn如果直接在 avcodec_read_frame 后面调用的话是正常的,但是我单独单出来一个线程就不行了。只有 ts 的特别的文件是这样子的。rnrn是我用错了吗,还是别的什么<em>问题</em>?rnrnrnrnvoid SaveFrame(AVFrame *pFrame, int width, int height, int iFrame) rnFILE *pFile;rnchar szFilename[32];rnint y;rnrn// Open filernsprintf(szFilename, "c:\\frame%d.ppm", iFrame);rnpFile=fopen(szFilename, "wb");rnif(pFile==NULL)rnreturn;rnrn// Write headerrnfprintf(pFile, "P6\n%d %d\n255\n", width, height);rnrn// Write pixel datarnfor(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);rnrn// Close filernfclose(pFile);rnrnrnint testcase(const char * file)rnrnint i;rnAVCodecContext *pCodecCtx;rnAVFrame *pFrame;rnAVCodec *pCodec;rnAVFormatContext *pFormatCtx;rnrnav_register_all();rnrn// Open video filernif(av_open_input_file(&pFormatCtx, file, NULL, 0, NULL) != 0)rnreturn -1; // Couldn't open filern// Retrieve stream informationrnif(av_find_stream_info(pFormatCtx)streams[videoStream]->codec;rnrn// Find the decoder for the video streamrnpCodec=avcodec_find_decoder(pCodecCtx->codec_id);rnif(pCodec==NULL) rnfprintf(stderr, "Unsupported codec!\n");rnreturn -1; // Codec not foundrnrn// Open codecrnif(avcodec_open(pCodecCtx, pCodec)width,rnpCodecCtx->height);rnbuffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));rnrn// Assign appropriate parts of buffer to image planes in pFrameRGBrn// Note that pFrameRGB is an AVFrame, but AVFrame is a supersetrn// of AVPicturernavpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,rnpCodecCtx->width, pCodecCtx->height);rnrnint frameFinished;rnAVPacket packet;rnrni=0;rnwhile(av_read_frame(pFormatCtx, &packet)>=0) rn// Is this a packet from the video stream?rnif(packet.stream_index==videoStream) rn// Decode video framernavcodec_decode_video2(pCodecCtx, pFrame, &frameFinished,rn&packet);rnrn// Did we get a video frame?rnif(frameFinished) rn// Convert the image from its native format to RGBrn// img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24, rn// (AVPicture*)pFrame, pCodecCtx->pix_fmt, rn// pCodecCtx->width, pCodecCtx->height);rnrnstatic struct SwsContext* m_convertCtx = sws_getContext(pCodecCtx->width,rnpCodecCtx->height,rnpCodecCtx->pix_fmt,rnpCodecCtx->width,rnpCodecCtx->height,rnPIX_FMT_RGB24,rnSWS_POINT,rnNULL,rnNULL,rnNULL);rnrn// Convert the image from its native format to RGBrnsws_scale(m_convertCtx,rnpFrame->data,rnpFrame->linesize,rn0,rnpCodecCtx->height,rnpFrameRGB->data,rnpFrameRGB->linesize);rnrn// Save the frame to diskrnif(++iwidth, rnpCodecCtx->height, i);rnrnrnelsernrnASSERT(false);rnrnrn// Free the packet that was allocated by av_read_framernav_free_packet(&packet);rnrnrn// Free the RGB imagernav_free(buffer);rnav_free(pFrameRGB);rnrn// Free the YUV framernav_free(pFrame);rnrn// Close the codecrnavcodec_close(pCodecCtx);rnrn// Close the video filernav_close_input_file(pFormatCtx);rnrnreturn 0;rnrnrnrn上面的代码,拿到的第一帧是错误的。第二帧是 I 帧。后来是可以保存图像的。rn但是当我把 AVPacket 压到一个队列中,然后另开了一个线程去解的时候,发现rn第二帧,就是 5006 的那帧,解出来报的是 B 帧。。。rn为什么同样的代码,难道放线程里还不一样吗。rnrnFFMPEG 是不是这样用的,一个对,然后放在另一个线程里解。rn有没有支招啊。rnrnrnrn另外,怎么在 FFMPEG 里启动 NEON 的编译。相对安卓。rnrn望各位达人指教。谢谢了。rnrn文件已上传 http://good.gd/1578793.htmrn大家帮忙看看是不是第一帧真的坏了?
ffmpeg 音频采样问题,没有声音
我是嵌入式Android平台,RK的板子rn 开始我用<em>ffmpeg</em>-1.0,声音是正常的,后来移植了<em>ffmpeg</em>-1.1和1.2的,都是没有声音的rn PC播放都没有<em>问题</em>rn 后来查到,<em>ffmpeg</em>-1.1以上的版本音频输入格式是AV_SAMPLE_FMT_FLTP(平面格式), 而不是原来的AV_SAMPLE_FMT_S16;(参考http://hi.baidu.com/excalibur/item/46b4472dca0fe250c28d5938)rn rn 我修改了这个函数:ff_audio_convert_alloc,依葫芦画瓢,增加两行转换: rn CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLTP, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *)pi * (1.0f / (1 << 15)))rnrn CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLTP, float, av_clip_int16( lrintf(*(const float *)pi * (1 << 15))))rnrn 结果AAC的LC格式的能播了,但是AAC-HE和其它格式例如WMV的都不行;rn 尝试了其它地方,修改了转换也不奏效;rn 熟悉<em>ffmpeg</em>音频采样的朋友,请指点一二;
ffmpeg x264问题
Ffmpeg+x264的编译<em>问题</em>rn1.在windows的xp系统下配置好的mingw + msys的编译器(之前成功编译过<em>ffmpeg</em>)rn2.安装了ysamrn ./configure --prefix=/usr/local/yasm ./configure --prefix=/usr--enable-sharedrn makern make installrn export PATH="$PATH:/usr/local/yasm/bin"rn vi /etc/profilern --[在最後,插入]--rn export PATH="$PATH:/usr/local/yasm/bin"rn --[存檔並關閉]--rnrn3.下载了最新的x264源代码“x264-snapshot-20110619-2245”rn ./configure --prefix=/usr/local --enable-shared --disable-asmrn 信息输出如下图:rn $ ./configure --prefix=/usr/local --enable-shared --disable-asmrn ./version.sh: line 2: git: command not foundrn Platform: X86rn System: WINDOWSrn cli: yesrn libx264: internalrn shared: yesrn static: norn asm: norn interlaced: yesrn avs: yesrn lavf: norn ffms: norn gpac: norn gpl: yesrn thread: posixrn filters: crop select_every rn debug: norn gprof: norn strip: norn PIC: norn visualize: norn bit depth: 8rn You can run 'make' or 'make fprofiled' now.rn 之后就执行【make】【make install】命令rn4. 下载<em>ffmpeg</em>-0.6.3版本rn Cd进入<em>ffmpeg</em>的根目录下,执行命令rn ./configure --enable-shared --enable-memalign-hack --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/librn 然后【make】接着【make install】.rn 有生成dll与lib文档(算是编译完成)。rn5.我在程序中调用的rn 静态库是(avcodec.lib avdevice.lib avformat.lib avutil.lib swscale.lib)rn 动态库是(avcodec-52.dll avdevice-52.dll avformat-52.dll avutil-50.dll swscale.dll)rn [color=#FF0000]最后在程序中一调用<em>ffmpeg</em>所提供的函数就会出现程序出错。 [/color]rn 谁在windows下成功编译过的给点意见,我的QQ:751482097
ffmpeg多线程解码的问题
我通过调用<em>ffmpeg</em>的库进行解码,多线程解码下对当文件不能解时解码会出现rn“insufficient thread locking around avcodec_open/avcodec_close”的错误。rn然后程序触发一个断点,停留在free.c中的heapfree部分。rn请教这是什么<em>问题</em>啊,怎样用ffmpg进行多线程的解码呢?rn据说<em>ffmpeg</em>有些函数不是线程安全的,是这样么?只在自己程序里加锁好像也不好使。。。。。。。
STC89C51和AT89S51的区别.doc下载
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。STC89C51和AT89S51的区别.doc 相关下载链接:[url=//download.csdn.net/download/gooodboooy/2562344?utm_source=bbsseo]//download.csdn.net/download/gooodboooy/2562344?utm_source=bbsseo[/url]
PhoenixTool 1.95 汉化版下载
Phoenix/Insyde/Dell/EFI BIOS 添加、替换 SLIC 和 SLP 字 串,破解 SLI,以及更新其他模块的工具。   PhoenixTool.exe为英文原版,PhoenixTool_cn.exe为汉化版。 注:1、修改BIOS时可能需要提供RW Everything报告。   2、用待改BIOS的电脑启动RW Everything(v1.2以上),菜单选 “Access”--&gt;“ACPI Tables”,ACPI Table窗口出现后,按Ctrl +F2保存RW报告。 声明:仅用于试验环境的技术研究以及漏洞的验证。不涉及任何有 版权的内容, 相关下载链接:[url=//download.csdn.net/download/donggelu/4059587?utm_source=bbsseo]//download.csdn.net/download/donggelu/4059587?utm_source=bbsseo[/url]
Computer Networking Ch1 Introduction下载
学校教授上课用的PPT,对应图书是computer networking, by Kurose 相关下载链接:[url=//download.csdn.net/download/jinperpanpan/6445331?utm_source=bbsseo]//download.csdn.net/download/jinperpanpan/6445331?utm_source=bbsseo[/url]
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件
我们是很有底线的