【转】FFPLAY的原理(五)

【ffplay播放器】ffplay 播放器整体架构 文章目录前言ffplay 简介ffplay中的线程主线程解复用线程 read_thread视频解码线程 video_thread音频解码线程 audio_thread音频播放线程总结技术参考 前言 ffplay 是入门播放器的非常合适的一个开源项目,支持本地视频文件播放,也支持网络流的播放。通过对 ffplay 的学习可以知道一个播放器如何工作的。这篇文章先整体介绍一下 ffplay 播放器的整体架构。从整体上对播放器的设计有个大概的了解。ijkplayer播放器内核是基于ffplay开发的,所以掌握 f 阅读详情

创建线程

Spawning Threads
Overview

Last time we added audio support by taking advantage of SDL's audio functions. SDL started a thread that made callbacks to a function we defined every time it needed audio. Now we're going to do the same sort of thing with the video display. This makes the code more modular and easier to work with - especially when we want to add syncing. So where do we start?

First we notice that our main function is handling an awful lot: it's running through the event loop, reading in packets, and decoding the video. So what we're going to do is split all those apart: we're going to have a thread that will be responsible for decoding the packets; these packets will then be added to the queue and read by the corresponding audio and video threads. The audio thread we have already set up the way we want it; the video thread will be a little more complicated since we have to display the video ourselves. We will add the actual display code to the main loop. But instead of just displaying video every time we loop, we will integrate the video display into the event loop. The idea is to decode the video, save the resulting frame in another queue, then create a custom event (FF_REFRESH_EVENT) that we add to the event system, then when our event loop sees this event, it will display the next frame in the queue. Here's a handy ASCII art illustration of what is going on:

________ audio   _______    _____
|        | pkts |    | |     | to spkr
| DECODE |----->| AUDIO |--->| SDL |-->
|________|    |_______| |_____|
|   video     _______
| pkts |    |
+---------->| VIDEO |
________    |_______| _______
|    |       |    |    |
| EVENT |       +------>| VIDEO | to mon.
| LOOP   |----------------->| DISP. |-->
|_______|<---FF_REFRESH----|_______|

The main purpose of moving controlling the video display via the event loop is that using an SDL_Delay thread, we can control exactly when the next video frame shows up on the screen. When we finally sync the video in the next tutorial, it will be a simple matter to add the code that will schedule the next video refresh so the right picture is being shown on the screen at the right time.
Simplifying Code

We're also going to clean up the code a bit. We have all this audio and video codec information, and we're going to be adding queues and buffers and who knows what else. All this stuff is for one logical unit, viz. the movie. So we're going to make a large struct that will hold all that information called the VideoState.

typedef struct VideoState {

   AVFormatContext *pFormatCtx;
   int          videoStream, audioStream;
   AVStream        *audio_st;
   PacketQueue     audioq;
   uint8_t       audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
   unsigned int audio_buf_size;
   unsigned int audio_buf_index;
   AVPacket        audio_pkt;
   uint8_t       *audio_pkt_data;
   int          audio_pkt_size;
   AVStream        *video_st;
   PacketQueue     videoq;

   VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE];
   int          pictq_size, pictq_rindex, pictq_windex;
   SDL_mutex    *pictq_mutex;
   SDL_cond        *pictq_cond;
  
   SDL_Thread    *parse_tid;
   SDL_Thread    *video_tid;

   char          filename[1024];
   int          quit;
} VideoState;

Here we see a glimpse of what we're going to get to. First we see the basic information - the format context and the indices of the audio and video stream, and the corresponding AVStream objects. Then we can see that we've moved some of those audio buffers into this structure. These (audio_buf, audio_buf_size, etc.) were all for information about audio that was still lying around (or the lack thereof). We've added another queue for the video, and a buffer (which will be used as a queue; we don't need any fancy queueing stuff for this) for the decoded frames (saved as an overlay). The VideoPicture struct is of our own creations (we'll see what's in it when we come to it). We also notice that we've allocated pointers for the two extra threads we will create, and the quit flag and the filename of the movie.

So now we take it all the way back to the main function to see how this changes our program. Let's set up our VideoState struct:

int main(int argc, char *argv[]) {

   SDL_Event    event;

   VideoState    *is;

   is = av_mallocz(sizeof(VideoState));

av_mallocz() is a nice function that will allocate memory for us and zero it out.

Then we'll initialize our locks for the display buffer (pictq), because since the event loop calls our display function - the display function, remember, will be pulling pre-decoded frames from pictq. At the same time, our video decoder will be putting information into it - we don't know who will get there first. Hopefully you recognize that this is a classic race condition. So we allocate it now before we start any threads. Let's also copy the filename of our movie into our VideoState.

pstrcpy(is->filename, sizeof(is->filename), argv[1]);

is->pictq_mutex = SDL_CreateMutex();
is->pictq_cond = SDL_CreateCond();

pstrcpy is a function from ffmpeg that does some extra bounds checking beyond strncpy.
Our First Thread

Now let's finally launch our threads and get the real work done:

schedule_refresh(is, 40);

is->parse_tid = SDL_CreateThread(decode_thread, is);
if(!is->parse_tid) {
   av_free(is);
   return -1;
}

schedule_refresh is a function we will define later. What it basically does is tell the system to push a FF_REFRESH_EVENT after the specified number of milliseconds. This will in turn call the video refresh function when we see it in the event queue. But for now, let's look at SDL_CreateThread().

SDL_CreateThread() does just that - it spawns a new thread that has complete access to all the memory of the original process, and starts the thread running on the function we give it. It will also pass that function user-defined data. In this case, we're calling decode_thread() and with our VideoState struct attached. The first half of the function has nothing new; it simply does the work of opening the file and finding the index of the audio and video streams. The only thing we do different is save the format context in our big struct. After we've found our stream indices, we call another function that we will define, stream_component_open(). This is a pretty natural way to split things up, and since we do a lot of similar things to set up the video and audio codec, we reuse some code by making this a function.

The stream_component_open() function is where we will find our codec decoder, set up our audio options, save important information to our big struct, and launch our audio and video threads. This is where we would also insert other options, such as forcing the codec instead of autodetecting it and so forth. Here it is:

int stream_component_open(VideoState *is, int stream_index) {

   AVFormatContext *pFormatCtx = is->pFormatCtx;
   AVCodecContext *codecCtx;
   AVCodec *codec;
   SDL_AudioSpec wanted_spec, spec;

   if(stream_index < 0 || stream_index >= pFormatCtx->nb_streams) {
return -1;
   }

   // Get a pointer to the codec context for the video stream
   codecCtx = pFormatCtx->streams[stream_index]->codec;

   if(codecCtx->codec_type == CODEC_TYPE_AUDIO) {
// Set audio settings from codec info
wanted_spec.freq = codecCtx->sample_rate;
/* .... */
wanted_spec.callback = audio_callback;
wanted_spec.userdata = is;

if(SDL_OpenAudio(&wanted_spec, &spec) < 0) {
   fprintf(stderr, "SDL_OpenAudio: %s/n", SDL_GetError());
   return -1;
}
   }
   codec = avcodec_find_decoder(codecCtx->codec_id);
   if(!codec || (avcodec_open(codecCtx, codec) < 0)) {
fprintf(stderr, "Unsupported codec!/n");
return -1;
   }

   switch(codecCtx->codec_type) {
   case CODEC_TYPE_AUDIO:
is->audioStream = stream_index;
is->audio_st = pFormatCtx->streams[stream_index];
is->audio_buf_size = 0;
is->audio_buf_index = 0;
memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
packet_queue_init(&is->audioq);
SDL_PauseAudio(0);
break;
   case CODEC_TYPE_VIDEO:
is->videoStream = stream_index;
is->video_st = pFormatCtx->streams[stream_index];

packet_queue_init(&is->videoq);
is->video_tid = SDL_CreateThread(video_thread, is);
break;
   default:
break;
   }
}This is pretty much the same as the code we had before, except now it's generalized for audio and video. Notice that instead of aCodecCtx, we've set up our big struct as the userdata for our audio callback. We've also saved the streams themselves as audio_st and video_st. We also have added our video queue and set it up in the same way we set up our audio queue. Most of the point is to launch the video and audio threads. These bits do it:

SDL_PauseAudio(0);
break;

/* ...... */

is->video_tid = SDL_CreateThread(video_thread, is);

We remember SDL_PauseAudio() from last time, and SDL_CreateThread() is used as in the exact same way as before. We'll get back to our video_thread() function.

Before that, let's go back to the second half of our decode_thread() function. It's basically just a for loop that will read in a packet and put it on the right queue:

for(;;) {
if(is->quit) {
   break;
}
// seek stuff goes here
if(is->audioq.size > MAX_AUDIOQ_SIZE ||
   is->videoq.size > MAX_VIDEOQ_SIZE) {
   SDL_Delay(10);
   continue;
}
if(av_read_frame(is->pFormatCtx, packet) < 0) {
   if(url_ferror(&pFormatCtx->pb) == 0) {
SDL_Delay(100); /* no error; wait for user input */
continue;
   } else {
break;
   }
}
// Is this a packet from the video stream?
if(packet->stream_index == is->videoStream) {
   packet_queue_put(&is->videoq, packet);
} else if(packet->stream_index == is->audioStream) {
   packet_queue_put(&is->audioq, packet);
} else {
   av_free_packet(packet);
}
   }

这里没有什么新东西,除了我们给音频和视频队列限定了一个最大值并且我们添加一个检测读错误的函数。格式上下文里面有一个叫做pb的 ByteIOContext类型结构体。这个结构体是用来保存一些低级的文件信息。函数url_ferror用来检测结构体并发现是否有些读取文件错误。

在循环以后,我们的代码是用等待其余的程序结束和提示我们已经结束的。这些代码是有益的,因为它指示出了如何驱动事件--后面我们将显示影像。

while(!is->quit) {

SDL_Delay(100);

}

fail:

if(1){

SDL_Event event;

event.type = FF_QUIT_EVENT;

event.user.data1 = is;

SDL_PushEvent(&event);

}

return 0;

我们使用SDL常量SDL_USEREVENT来从用户事件中得到值。第一个用户事件的值应当是SDL_USEREVENT,下一个是 SDL_USEREVENT+1并且依此类推。在我们的程序中FF_QUIT_EVENT被定义成SDL_USEREVENT+2。如果喜欢,我们也可以 传递用户数据,在这里我们传递的是大结构体的指针。最后我们调用SDL_PushEvent()函数。在我们的事件分支中,我们只是像以前放入 SDL_QUIT_EVENT部分一样。我们将在自己的事件队列中详细讨论,现在只是确保我们正确放入了FF_QUIT_EVENT事件,我们将在后面捕 捉到它并且设置我们的退出标志quit。

得到帧:video_thread

当我们准备好解码器后,我们开始视频线程。这个线程从视频队列中读取包,把它解码成视频帧,然后调用queue_picture函数把处理好的帧放入到图片队列中:

int video_thread(void *arg) {

VideoState *is = (VideoState *)arg;

AVPacket pkt1, *packet = &pkt1;

int len1, frameFinished;

AVFrame *pFrame;

pFrame = avcodec_alloc_frame();

for(;;) {

if(packet_queue_get(&is->videoq, packet, 1) < 0) {

// means we quit getting packets

break;

}

// Decode video frame

len1 = avcodec_decode_video(is->video_st->codec, pFrame, &frameFinished,

packet->data, packet->size);

// Did we get a video frame?

if(frameFinished) {

if(queue_picture(is, pFrame) < 0) {

break;

}

}

av_free_packet(packet);

}

av_free(pFrame);

return 0;

}

在这里的很多函数应该很熟悉吧。我们把avcodec_decode_video函数移到了这里,替换了一些参数,例如:我们把AVStream保存在我 们自己的大结构体中,所以我们可以从那里得到编解码器的信息。我们仅仅是不断的从视频队列中取包一直到有人告诉我们要停止或者出错为止。

把帧队列化

让我们看一下保存解码后的帧pFrame到图像队列中去的函数。因为我们的图像队列是SDL的覆盖的集合(基本上不用让视频显示函数再做计算了),我们需要把帧转换成相应的格式。我们保存到图像队列中的数据是我们自己做的一个结构体。

typedef struct VideoPicture {

SDL_Overlay *bmp;

int width, height;

int allocated;

} VideoPicture;

我们的大结构体有一个可以保存这些缓冲区。然而,我们需要自己来申请SDL_Overlay(注意:allocated标志会指明我们是否已经做了这个申请的动作与否)。

为了使用这个队列,我们有两个指针--写入指针和读取指针。我们也要保证一定数量的实际数据在缓冲中。要写入到队列中,我们先要等待缓冲清空以便于有位置 来保存我们的VideoPicture。然后我们检查看我们是否已经申请到了一个可以写入覆盖的索引号。如果没有,我们要申请一段空间。我们也要重新申请 缓冲如果窗口的大小已经改变。然而,为了避免被锁定,尽量避免在这里申请(我现在还不太清楚原因;我相信是为了避免在其它线程中调用SDL覆盖函数的原 因)。

int queue_picture(VideoState *is, AVFrame *pFrame) {

VideoPicture *vp;

int dst_pix_fmt;

AVPicture pict;

SDL_LockMutex(is->pictq_mutex);

while(is->pictq_size >= VIDEO_PICTURE_QUEUE_SIZE &&

!is->quit) {

SDL_CondWait(is->pictq_cond, is->pictq_mutex);

}

SDL_UnlockMutex(is->pictq_mutex);

if(is->quit)

return -1;

// windex is set to 0 initially

vp = &is->pictq[is->pictq_windex];

if(!vp->bmp ||

vp->width != is->video_st->codec->width ||

vp->height != is->video_st->codec->height) {

SDL_Event event;

vp->allocated = 0;

event.type = FF_ALLOC_EVENT;

event.user.data1 = is;

SDL_PushEvent(&event);

SDL_LockMutex(is->pictq_mutex);

while(!vp->allocated && !is->quit) {

SDL_CondWait(is->pictq_cond, is->pictq_mutex);

}

SDL_UnlockMutex(is->pictq_mutex);

if(is->quit) {

return -1;

}

}

这里的事件机制与前面我们想要退出的时候看到的一样。我们已经定义了事件FF_ALLOC_EVENT作为SDL_USEREVENT。我们把事件发到事件队列中然后等待申请内存的函数设置好条件变量。

让我们来看一看如何来修改事件循环:

for(;;) {

SDL_WaitEvent(&event);

switch(event.type) {

case FF_ALLOC_EVENT:

alloc_picture(event.user.data1);

break;

记住event.user.data1是我们的大结构体。就这么简单。让我们看一下alloc_picture()函数:

void alloc_picture(void *userdata) {

VideoState *is = (VideoState *)userdata;

VideoPicture *vp;

vp = &is->pictq[is->pictq_windex];

if(vp->bmp) {

// we already have one make another, bigger/smaller

SDL_FreeYUVOverlay(vp->bmp);

}

// Allocate a place to put our YUV image on that screen

vp->bmp = SDL_CreateYUVOverlay(is->video_st->codec->width,

is->video_st->codec->height,

SDL_YV12_OVERLAY,

screen);

vp->width = is->video_st->codec->width;

vp->height = is->video_st->codec->height;

SDL_LockMutex(is->pictq_mutex);

vp->allocated = 1;

SDL_CondSignal(is->pictq_cond);

SDL_UnlockMutex(is->pictq_mutex);

}

你可以看到我们把SDL_CreateYUVOverlay函数从主循环中移到了这里。这段代码应该完全可以自我注释。记住我们把高度和宽度保存到VideoPicture结构体中因为我们需要保存我们的视频的大小没有因为某些原因而改变。

好,我们几乎已经全部解决并且可以申请到YUV覆盖和准备好接收图像。让我们回顾一下queue_picture并看一个拷贝帧到覆盖的代码。你应该能认出其中的一部分:

int queue_picture(VideoState *is, AVFrame *pFrame) {

if(vp->bmp) {

SDL_LockYUVOverlay(vp->bmp);

dst_pix_fmt = PIX_FMT_YUV420P;

pict.data[0] = vp->bmp->pixels[0];

pict.data[1] = vp->bmp->pixels[2];

pict.data[2] = vp->bmp->pixels[1];

pict.linesize[0] = vp->bmp->pitches[0];

pict.linesize[1] = vp->bmp->pitches[2];

pict.linesize[2] = vp->bmp->pitches[1];

// Convert the image into YUV format that SDL uses

img_convert(&pict, dst_pix_fmt,

(AVPicture *)pFrame, is->video_st->codec->pix_fmt,

is->video_st->codec->width, is->video_st->codec->height);

SDL_UnlockYUVOverlay(vp->bmp);

if(++is->pictq_windex == VIDEO_PICTURE_QUEUE_SIZE) {

is->pictq_windex = 0;

}

SDL_LockMutex(is->pictq_mutex);

is->pictq_size++;

SDL_UnlockMutex(is->pictq_mutex);

}

return 0;

}

这部分代码和前面用到的一样,主要是简单的用我们的帧来填充YUV覆盖。最后一点只是简单的给队列加1。这个队列在写的时候会一直写入到满为止,在读的时 候会一直读空为止。因此所有的都依赖于is->pictq_size值,这要求我们必需要锁定它。这里我们做的是增加写指针(在必要的时候采用轮转 的方式),然后锁定队列并且增加尺寸。现在我们的读者函数将会知道队列中有了更多的信息,当队列满的时候,我们的写入函数也会知道。

 
ffplay源码分析1-概述 本文为作者原创,转载请注明出处:https://www.cnblogs.com/leisure_chn/p/10301215.html ffplay是一个很简单的播放器,但是初次接触仍会感到概念和细节相当繁多,分析并不容易。深入理解一项技术需要足够的时间和大量的实践,由浅入深逐步迭代,没有时间就成了最大难题。本次分析过程断断续续持续了挺久,先是边读代码边加注释,后面才整理了笔记,再加上理解浅薄很难... 阅读详情

相关推荐

最简单的基于FFmpeg的AVDevice例子(读取摄像头)

FFmpeg中有一个和多媒体设备交互的类库:Libavdevice。使用这个库可以读取电脑(或者其他设备上)的多媒体设备的数据,或者输出数据到指定的多媒体设备上。 Libavdevice支持以下设备作为输入端: alsa avfoundation bktr dshow dv1394 fbdev gdigrab iec61883 jack lavfi libcdio lib

tianyu的专栏 - Linux site:blog.csdn.net/wishfly 2289

ffmpeg关于读取av_read_frame音频数据时,AVPacket字段的说明

用ffmpeg读取系统声音时,如下所示 av_read_frame(pFormatCtx_Audio, &packet) ; packet中pts,dts,duration都是基于pFormatCtx_Audio里面对应AVStream的time_base。 下面我们看下AVStream里面的time_base是1000 0000,即1千万一秒。 然后我们读取一个packet,其值如下所示: pts和dts都是1303426380000,这个值太大,我们先不管,我们看下duration字段,值1

tusong86的博客 2542

ffplay播放器原理学习

ffplay 播放器从原理上来讲和 windows directshow 差不多,只是没有使用 driectshow 那些名词术语来表述。从 directshow 的视角来看 ffplay 播放器,简单的划分一下模块和各个模块的文件,有些文件可能在多个模块中都有用到,只能不严格的划分。 Source filter Source filter 读文件模块,可以简单的分为 3 层,最底层的是 file,pipe,tcp,udp,http 等这些具体的本地文件或网络协议(注意 ffplay 把 file 也当协议

道亦无名 607

做ffmpeg解码视频,显示图像中的函数的使用说明

AVFormatContext *pFormatCtx; AVCodecContext *pCodecCtx; AVCodec *pCodec; AVFrame *pFrame, *pFrameRGB; AVPacket *packet; AVCodecContext *aCodecCtx; AVCodec *aCodec; 常见的函数与用法: 1、 void av_register_all(...

lailaiquququ11的博客 611

FFmpeg之编译ffplay(十四)

问题: 若要ffmpeg源码编译出ffplay,需要先编译出SDL,安装到系统后,ffmpeg源码才能编译出ffplay. 解决: 一、编译SDL # wget http://libsdl.org/release/SDL2-2.0.14.tar.gz # tar zxvf SDL2-2.0.14.tar.gz # cd SDL2-2.0.14 # mkdir build # cd build # cmake .. # make -j4 # sudo make install 二、编译ffmpeg.

Android系统攻城狮 1878

从零开始:用摩尔线程S4000运行开源AI项目的完整流程

本文详细介绍了如何使用摩尔线程S4000 GPU从零开始运行开源AI项目的完整流程,包括硬件选择、驱动安装、容器化环境配置以及典型AI项目的实战部署。通过性能优化技巧,显著提升推理速度,适合开发者快速上手国产GPU的AI应用开发。

weixin_29231725的博客 598

关于ffmpeg解码内存增加解决方案-替换解码代码

Linux环境:Ubuntu16.4ffmpeg库版本:ffmpeg-3.4.1问题:最近在弄ffmpeg视频解码,由于项目的需要,需要一直重复播放链表中挂在的图片,一直循环,但是遇到一个问题是,每次调用ffmpeg图像解码函数,使用top命令查看程序所占内存大小,发现每调用一次内存就增加一点,最后占掉了系统所有的内存,被系统防护机制杀掉了。尝试解决:1、遇到上述问题之后,我开始怀疑是不是我忘记释...

Chasing_Chasing的博客 8104

复现HumanMAC(HumanMAC: Masked Motion Completion for Human Motion Prediction)

Human3.6M和HumanEva-I都放到data目录下(记得将data_multi_modal-20250320T022408Z-001.zip和humaneva_multi_modal-20250320T022412Z-001.zip解压缩并且分别重命名为data_multi_modal和humaneva_multi_modal)。生成的gif存放在inference目录下zero_shot_<INDEX>下的out目录下。新建一个data目录,将

qq_52643100的博客 842

运用ffmpeg SDK解264码流(来源FFmpeg工程组)

Link:http://www.ffmpeg.com.cn/index.php/%E8%BF%90%E7%94%A8SDK%E8%A7%A3264%E7%A0%81%E6%B5%81 运用SDK解264码流 方法一: 最好参考ffmpeg自带的两个例子,outputexample.c和apiexample.c文件, 亦或直接看ffmpeg和ffplay的例程也可,如果你是需要重量级的使

lovey_carolin的专栏 1140

新一代XMOS会议四麦方案主控芯片 XVF3800

2023年,知名的音频芯片制造厂商 XMOS 正式发布了新一代会议麦阵芯片片 XVF3800 ,这款芯片采用最先进的四麦音频算法,可在嘈杂的环境中提供高质量语音,算法支持圆形、条形阵列,可根据应用场景组成不同的产品形态。传统的麦阵解决方案,不仅需要捕捉会议中的人声,也会同时捕捉环境中的其他噪声,而 XMOS 先进的语音算法解决了这一问题。声学回声消除功能可消除麦克风音频输入的回声,同时减少远端回声,使 XVF3800 能提取清晰的语音信号。• 180度拾音条形麦克风阵列。• 360度拾音环形麦克风阵列。

PawPaw_electron的博客 790

ffplay播放器移植VC的工程:ffplay for MFC

ffplay播放器移植VC的工程:ffplayfor MFC本文介绍一个自己做的FFPLAY移植到VC下的开源工程:ffplayfor MFC。本工程将ffmpeg项目中的ffplay播放器(ffplay.c)移植到了VC的环境下。并且使用MFC做了一套简单的界面。它可以完成一个播放器播放视频的基本流程:解协议,解封装,视频/音频解码,视音频同步,视音频输出。此外还包含一些控制功能:播放,暂停/继

雷霄骅(leixiaohua1020)的专栏 3万+

数据标注的下一代SOP,可能不是Word,而是一段Prompt

再给几个反例:“这个只是正常纹理,不算。真正用于数据生产的Prompt,可能至少包含:任务定义、正例、反例、边界案例、优先级、输出格式、验收逻辑。一个项目100个人,如果100个人对这句话有100种理解,最后返工的就不是一个框,而可能是几十万帧数据。一个项目启动以后,项目经理先研究SOP,培训组长,组长再培训标注员,最后几百个人按照同一套规则干活。实际上一个成熟的项目经理,最重要的能力之一,就是:把客户的业务语言翻译成生产规则。真正让项目难交付的,从来不是80%的普通数据,而是那20%的长尾数据。

AI数据标注猿 300

ffplay播放器原理剖析

详细分析ffplay的基本框架及工作机制。

RonnieLiGe的专栏 3107

使用Wireshark抓取用户在网站的登陆密码

(POST请求是浏览器向服务器提交数据的方式,我们的用户名和密码就是这样提交出去的),单击点开,发现我们的账号和密码,就被抓取到了,在。(注意哦,要去掉http和/,比如http://www.4399.com/,我们只需要记下4399.com即可)(这句话是筛选数据,就是只显示IP为我们要抓取网站的数据) ,点击右边的蓝色箭头。这就是Wireshark简单的抓取登录密码的教程,只适用于http协议的网站。”打开,是这个样子,上面的数据先不用管,我们先点击左上角红色的方块停止抓包。,然后回车,得到的IP为。

泡泡的博客 1万+

(第100天)Oracle GoldenGate 常见故障处理指南

OGG 运维的核心在于细致的配置管理和主动的问题排查。熟悉常见错误、掌握关键操作流程、并善用日志和调试工具,是保障数据同步任务稳定运行的关键。希望这份指南能帮助您更高效地解决 OGG 同步中遇到的问题。祝您运维顺利!

LuciferLiu_DBA 312

ffplay播放器研究分析

PacketQueue设计思路:设计⼀个多线程安全的队列引⼊serial的概念,区别前后数据包是否连续,主要应⽤于seek操作。设计了两类特殊的packet——flush_pkt和nullpkt(类似⽤于多线程编程的事件模型——往队列中放⼊ flush事件、放⼊null事件),我们在⾳频输出、视频输出、播放控制等模块时也会继续对flush_pkt和 nullpkt的作⽤展开分析。创建视频图像缩放上下文的函数。第⼀参数可以传NULL,默认会开辟⼀块新的空间。

weixin_50873490的博客 1477

深入探究ASP.NET Core读取Request.Body的正确方式

前言# 相信大家在使用ASP.NET Core进行开发的时候,肯定会涉及到读取Request.Body的场景,毕竟我们大部分的POST请求都是将数据存放到Http的Body当中。因为笔者日常开发所使用的主要也是ASP.NET Core所以笔者也遇到这这种场景,关于本篇文章所套路的内容,来自于在开发过程中我遇到的关于Request.Body的读取问题。在之前的使用的时候,基本上都是借助搜索引擎搜索的答案,并没有太关注这个,发现自己理解的和正确的使用之间存在很大的误区。故有感而发,便写下此文,以作记录。学无止境

萌兔兔MMQ!! 783

ffplay视频播放原理分析

本文从整体播放流程出发,介绍了 ffplay 播放器播放媒体文件的主要流程,不深陷于代码细节。

lihui49的博客 1229

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

ffplay播放器

1 ffplay.c的意义 ffplay.c是FFmpeg源码⾃带的播放器,调⽤FFmpeg和SDL API实现⼀个⾮常有⽤的播放器。 例如哔哩哔哩著名开源项⽬ijkplayer也是基于ffplay.c进⾏⼆次开发。 ffplay实现了播放器的主体功能,掌握其原理对于我们独⽴开发播放器⾮常有帮助。 2 FFplay框架分析 播放器初始化 初始化packet queue 初始化frame queue 初始化clock 创建数据读取线程 线程的划分 数据读取线程 打开媒体⽂件 打开对应码流的decod

李点点 1897

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

音频和视频同步ffplay5原理

[转]音频和视频同步ffplay5原理(网上资料加个人理解,欢迎跟帖探讨) PTS和DTS 接触FFMPEG应用程序时间不长,一共8个tutorial,现在看到了第5个,花的时间最长,理解也是最难的。里面首先把电影文件分为audio和video,其中每个packet

tangchao198507的专栏 733

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ffplay.c源码阅读之音频、字幕、视频渲染原理

ffplay.c源码阅读之音频、字幕、视频渲染原理

m0_60259116的博客 818

ffplay实现原理

## ffmpeg是音视频界的瑞士军刀: 1. 它提供了从录制、编码、封装、推流到拉流、解封装、解码、滤镜、播放的完整解决方案。 2. 它是跨平台的解决方案,一套代码适配Windows、Linux、Mac OS、iOS、Andriod。 3. 它原生支持hls、dash、rtmp、rtsp、http、tcp等主流协议,并提供统一的扩展方式方便扩展自己的协议,比如tutk、webrtc等,目前已经有开源库metaRTC可通过扩展集成到ffmpeg中实现webrtc的推拉流。 4. 它支持或插件支持所有封装格式

fsmpeg的博客 671

ffplay实现功能大全

ffplay 是一个基于 SDL 和 FFmpeg 的简单播放器,支持多种播放控制功能。通过键盘事件,用户可以实现播放、暂停、静音、音量调节、全屏切换、逐帧播放等操作。播放器启动时自动播放,暂停时通过 p 或空格键恢复。暂停状态下,视频停止解码并停留在最后一帧,音频则通过填充静音数据或停止解码来处理。时钟同步机制确保暂停和恢复时的音视频同步,暂停时时钟停止更新,恢复时通过计算暂停时间差来修正时钟。数据读取线程在暂停时停止读取新数据包,恢复时重新唤醒解码线程继续处理数据。

m0_73359068的博客 1154

ffplay音视频同步分析

double pts;// 当前帧(待播放)显示时间戳,播放后,当前帧变成上一帧//两时间差值,可以理解为持续时间// 最后一次更新的系统时钟// 时钟速度控制,用于控制播放速度int serial;int paused;// = 1 说明是暂停状态} Clock;audio:视频同步到⾳频。上⼀节中的A被触发,video输出需要作同步,同步的参考 (get_master_clock)是audclk.video:⾳频同步到视频。

weixin_50873490的博客 1322

ffplay 外部时钟同步的原理

概述 ffplay有三种同步方式:1、音频作为主时钟;2、视频作为主时钟;3、外部时钟源作为主时钟。默认的同步方式为“音频作为主时钟”方式,具体代码分析可查阅:https://blog.csdn.net/lyy901135/article/details/95307111 音频作为主时钟时,视频pts向音频的pts看齐,若视频播放延迟,则需进行丢帧处理。视频作为主时钟时,音频需向视频的pts看齐,...

lyy901135的博客 1888
上一篇: 【转】FFPLAY的原理(四)
下一篇: 【转】FFPLAY的原理(六)
code09
博客等级 码龄18年 31粉丝 56原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值
⌂ 换网址