没有实现,可能是时间戳同步问题 

#include <stdio.h>
#include<iostream>
#include<Windows.h>
#define __STDC_CONSTANT_MACROS#ifdef _WIN32
//Windows
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libswscale/swscale.h"
#include "libavdevice/avdevice.h"
#include "libavutil/imgutils.h"
#include "libavutil/time.h"
#include "libavutil/avstring.h"
#include "libswresample/swresample.h"
#include "SDL.h"
};
#else
//Linux...
#ifdef __cplusplus
extern "C"
{
#endif
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavdevice/avdevice.h>
#include <SDL/SDL.h>
#ifdef __cplusplus
};
#endif
#endif/*
FIX: H.264 in some container format (FLV, MP4, MKV etc.) need
"h264_mp4toannexb" bitstream filter (BSF)
*Add SPS,PPS in front of IDR frame
*Add start code ("0,0,0,1") in front of NALU
H.264 in some container (MPEG2TS) don't need this BSF.
*/
//'1': Use H.264 Bitstream Filter 
#define USE_H264BSF 0/*
FIX:AAC in some container format (FLV, MP4, MKV etc.) need
"aac_adtstoasc" bitstream filter (BSF)
*/
//'1': Use AAC Bitstream Filter 
#define USE_AACBSF 0#define USE_SDL 1#define SWR_CH_MAX 32
#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio/* The output bit rate in bit/s */
#define OUTPUT_BIT_RATE 96000
/* The number of output channels */
#define OUTPUT_CHANNELS 2//Refresh Event
#define SFM_REFRESH_EVENT  (SDL_USEREVENT + 1)#define SFM_BREAK_EVENT  (SDL_USEREVENT + 2)int thread_exit = 0;
#pragma region print info function//Show Dshow Device
void show_dshow_device() {AVFormatContext *ifmt_ctx = avformat_alloc_context();AVDictionary* options = NULL;av_dict_set(&options, "list_devices", "true", 0);AVInputFormat *iformat = av_find_input_format("dshow");printf("========Device Info=============\n");avformat_open_input(&ifmt_ctx, "video=dummy", iformat, &options);printf("================================\n");
}//Show Dshow Device Option
void show_dshow_device_option() {AVFormatContext *ifmt_ctx = avformat_alloc_context();AVDictionary* options = NULL;av_dict_set(&options, "list_options", "true", 0);AVInputFormat *iformat = av_find_input_format("dshow");printf("========Device Option Info======\n");avformat_open_input(&ifmt_ctx, "video=USB2.0 PC CAMERA", iformat, &options);printf("================================\n");
}//Show VFW Device
void show_vfw_device() {AVFormatContext *ifmt_ctx = avformat_alloc_context();AVInputFormat *iformat = av_find_input_format("vfwcap");printf("========VFW Device Info======\n");avformat_open_input(&ifmt_ctx, "list", iformat, NULL);printf("=============================\n");
}//Show AVFoundation Device
void show_avfoundation_device() {AVFormatContext *ifmt_ctx = avformat_alloc_context();AVDictionary* options = NULL;av_dict_set(&options, "list_devices", "true", 0);AVInputFormat *iformat = av_find_input_format("avfoundation");printf("==AVFoundation Device Info===\n");avformat_open_input(&ifmt_ctx, "", iformat, &options);printf("=============================\n");
}
#pragma endregionint sfp_refresh_thread(void *opaque)
{thread_exit = 0;while (!thread_exit) {SDL_Event event;event.type = SFM_REFRESH_EVENT;SDL_PushEvent(&event);SDL_Delay(40);}thread_exit = 0;//BreakSDL_Event event;event.type = SFM_BREAK_EVENT;SDL_PushEvent(&event);return 0;
}
static  Uint8  *audio_chunk;
static  Uint32  audio_len;
static  Uint8  *audio_pos;
/* The audio function callback takes the following parameters:
* stream: A pointer to the audio buffer to be filled
* len: The length (in bytes) of the audio buffer
*/
void  fill_audio(void *udata, Uint8 *stream, int len) {//SDL 2.0SDL_memset(stream, 0, len);if (audio_len == 0)return;len = (len>audio_len ? audio_len : len);	/*  Mix  as  much  data  as  possible  */SDL_MixAudio(stream, audio_pos, len, SDL_MIX_MAXVOLUME);audio_pos += len;audio_len -= len;
}
static char *dup_wchar_to_utf8(wchar_t *w)
{char *s = NULL;int l = WideCharToMultiByte(CP_UTF8, 0, w, -1, 0, 0, 0, 0);s = (char *)av_malloc(l);if (s)WideCharToMultiByte(CP_UTF8, 0, w, -1, s, l, 0, 0);return s;
}//setup_array函数摘自ffmpeg例程
static void setup_array(uint8_t* out[SWR_CH_MAX], AVFrame* in_frame, int format, int samples)
{if (av_sample_fmt_is_planar((AVSampleFormat)format)){int i; int plane_size = av_get_bytes_per_sample((AVSampleFormat)(format & 0xFF)) * samples; format &= 0xFF;//从decoder出来的frame中的data数据不是连续分布的,所以不能这样写:in_frame->data[0] + i*plane_size;for (i = 0; i < in_frame->channels; i++){out[i] = in_frame->data[i];}}else{out[0] = in_frame->data[0];}
}int main(int argc, char* argv[])
{AVFormatContext	*ifmt_ctx_video = NULL;AVFormatContext	*ifmt_ctx_audio = NULL;AVCodecContext	*inCodecCtx_v;AVCodecContext	*inCodecCtx_a;int in_videoindex;int in_audioindex;AVCodec			*in_video_Codec = NULL;AVCodec			*in_audio_Codec = NULL;AVAudioFifo *fifo = NULL;AVFormatContext *ofmt_ctx = NULL;AVOutputFormat *ofmt = NULL;AVCodecContext	*outCodecCtx_v = NULL;AVCodecContext	*outCodecCtx_a = NULL;int out_videoindex;int out_audioindex;AVStream		*out_video_st = NULL;AVStream		*out_audio_st = NULL;AVCodec			*out_video_Codec = NULL;AVCodec			*out_audio_Codec = NULL;//AVPacket		pkt;int				ret = -1;int				got_frame = -1;int				got_packet = -1;int64_t cur_pts_v = 0, cur_pts_a = 0;static int64_t audio_pts = 0;int frame_index = 0;int frame_index_a = 0;//const char  *out_filename = "rtmp://localhost:1935/live/room";;const char  *out_filename = "d:/test33.flv";int64_t start_time = 0;//av_register_all();avformat_network_init();//Register Deviceavdevice_register_all();//Show Dshow Deviceshow_dshow_device();//Show Device Optionsshow_dshow_device_option();//Show VFW Optionsshow_vfw_device();AVInputFormat *ifmt = av_find_input_format("dshow");#pragma region open camera//分配视频输入上下文ifmt_ctx_video = avformat_alloc_context();//Set own video device's namechar * psCameraName = dup_wchar_to_utf8(L"video=USB2.0 PC CAMERA");if (avformat_open_input(&ifmt_ctx_video, "video=USB2.0 PC CAMERA", ifmt, NULL) != 0) {printf("Couldn't open input stream.(无法打开视频输入流)\n");return -1;}if (avformat_find_stream_info(ifmt_ctx_video, NULL) < 0){printf("Couldn't find stream information.(无法获取流信息)\n");return -1;}in_videoindex = -1;for (int i = 0; i < ifmt_ctx_video->nb_streams; i++){if (ifmt_ctx_video->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO){in_videoindex = i;break;}}if (in_videoindex == -1){printf("Couldn't find a video stream.(没有找到视频流)\n");return -1;}in_video_Codec = avcodec_find_decoder(ifmt_ctx_video->streams[in_videoindex]->codecpar->codec_id);inCodecCtx_v = avcodec_alloc_context3(in_video_Codec);avcodec_parameters_to_context(inCodecCtx_v, ifmt_ctx_video->streams[in_videoindex]->codecpar);if (in_video_Codec == NULL){printf("Codec not found.(无法找到视频解码器编码)\n");return -1;}if (avcodec_open2(inCodecCtx_v, in_video_Codec, NULL) < 0){printf("Could not open codec.(无法打开视频解码器)\n");return -1;}//Dump Format video------------av_dump_format(ifmt_ctx_video, 0, "video=USB2.0 PC CAMERA", 0);
#pragma endregion#pragma region open micifmt_ctx_audio = avformat_alloc_context();char * psMicDevName = dup_wchar_to_utf8(L"audio=麦克风 (USB2.0 MIC)");if (avformat_open_input(&ifmt_ctx_audio, psMicDevName, ifmt, NULL) != 0) {printf("Couldn't open input stream.(无法打开输入流)\n");return -1;}AVDictionary* pOptions = NULL;ifmt_ctx_audio->probesize = 1 * 1024;ifmt_ctx_audio->max_analyze_duration = 1 * AV_TIME_BASE;if (avformat_find_stream_info(ifmt_ctx_audio, &pOptions) < 0){printf("Couldn't find stream information.(无法获取流信息)\n");return -1;}in_audioindex = -1;for (int i = 0; i < ifmt_ctx_audio->nb_streams; i++)if (ifmt_ctx_audio->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO){in_audioindex = i;break;}if (in_audioindex == -1){printf("Couldn't find a video stream.(没有找到视频流)\n");return -1;}in_audio_Codec = avcodec_find_decoder(ifmt_ctx_audio->streams[in_audioindex]->codecpar->codec_id);if (in_audio_Codec == NULL){printf("Codec not found.(无法找到视频解码器编码)\n");return -1;}inCodecCtx_a = avcodec_alloc_context3(NULL);avcodec_parameters_to_context(inCodecCtx_a, ifmt_ctx_audio->streams[in_audioindex]->codecpar);if (avcodec_open2(inCodecCtx_a, in_audio_Codec, NULL) < 0){printf("Could not open codec.(无法打开视频解码器)\n");return -1;}//Dump Format audio------------av_dump_format(ifmt_ctx_audio, 0, psMicDevName, 0);#pragma endregion
#pragma region outputavformat_alloc_output_context2(&ofmt_ctx, NULL, "flv", out_filename);if (!ofmt_ctx) {printf("Could not create output context(不能创建输出上下文)\n");return -1;}ofmt = ofmt_ctx->oformat;if (ifmt_ctx_video->streams[in_videoindex]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO){//set codec context paramout_video_Codec = avcodec_find_encoder(AV_CODEC_ID_H264);if (!out_video_Codec) {printf("can not find encoder !\n");return -1;}outCodecCtx_v = avcodec_alloc_context3(out_video_Codec);if (!outCodecCtx_v) {printf("can not alloc context!\n");return -1;}// take first format from list of supported formatsoutCodecCtx_v->pix_fmt = AV_PIX_FMT_YUV422P;outCodecCtx_v->height = ifmt_ctx_video->streams[in_videoindex]->codecpar->height;outCodecCtx_v->width = ifmt_ctx_video->streams[in_videoindex]->codecpar->width;outCodecCtx_v->sample_aspect_ratio = inCodecCtx_a->sample_aspect_ratio; // 采样宽高比:像素宽/像素高outCodecCtx_v->time_base.num = 1;outCodecCtx_v->time_base.den = 25;outCodecCtx_v->framerate = inCodecCtx_v->framerate;outCodecCtx_v->bit_rate = 400000;outCodecCtx_v->gop_size = 250;if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)outCodecCtx_v->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;outCodecCtx_v->qmin = 10;outCodecCtx_v->qmax = 51;outCodecCtx_v->max_b_frames = 3;//Optional Param  AVDictionary *param = 0;av_dict_set(&param, "preset", "ultrafast", 0);//解码时花屏,加上有花屏,去掉有延时av_dict_set(&param, "tune", "zerolatency", 0);//av_dict_set(&param, "rtbufsize", 3041280 , 0);if (avcodec_open2(outCodecCtx_v, out_video_Codec, &param) < 0) {printf("Failed to open encoder! (编码器打开失败!)\n");return -1;}out_video_st = avformat_new_stream(ofmt_ctx, out_video_Codec);if (!out_video_st){printf("can not new stream for output!\n");return -1;}out_video_st->time_base.num = 1;out_video_st->time_base.den = 25;//video_st->codec = oCodecCtx;avcodec_parameters_from_context(out_video_st->codecpar, outCodecCtx_v);out_videoindex = out_video_st->index;}if (ifmt_ctx_audio->streams[in_audioindex]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO){/*for (int i = 0; i < ifmt_ctx_audio->nb_streams; i++) {//根据输入流创建输出流(Create output AVStream according to input AVStream)AVStream *in_stream = ifmt_ctx_audio->streams[i];AVCodec *codec = NULL;codec = avcodec_find_decoder(in_stream->codecpar->codec_id);AVStream *out_stream = avformat_new_stream(ofmt_ctx, codec);if (!out_stream) {printf("Failed allocating output stream\n");ret = AVERROR_UNKNOWN;goto end;}out_audioindex = out_stream->index;AVCodecContext *codec_ctx = avcodec_alloc_context3(codec);ret = avcodec_parameters_to_context(codec_ctx, in_stream->codecpar);if (ret < 0){printf("Failed to copy in_stream codecpar to codec context\n");goto end;}codec_ctx->codec_tag = 0;if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)codec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;ret = avcodec_parameters_from_context(out_stream->codecpar, codec_ctx);out_stream->codecpar->codec_tag = 0;if (ret < 0){printf("Failed to copy codec context to out_stream codecpar context\n");goto end;}//avcodec_free_context(&codec_ctx);}*///set codec context paramout_audio_Codec = avcodec_find_encoder(AV_CODEC_ID_MP3);if (!out_audio_Codec) {printf("can not find encoder !\n");return -1;}//初始化音频输出流//out_audio_st = avformat_new_stream(ofmt_ctx, out_audio_Codec);out_audio_st = avformat_new_stream(ofmt_ctx, out_audio_Codec);if (!out_audio_st){printf("can not new stream for output!\n");return -1;}out_audioindex = out_audio_st->index;//分配音频输出上下文outCodecCtx_a = avcodec_alloc_context3(out_audio_Codec);if (!outCodecCtx_a) {printf("can not alloc context!\n");return -1;}avcodec_parameters_to_context(outCodecCtx_a, out_audio_st->codecpar);//set codec context param//use default audio encoder//use the input audio encoderoutCodecCtx_a->sample_rate = inCodecCtx_a->sample_rate;outCodecCtx_a->channel_layout = inCodecCtx_a->channel_layout;outCodecCtx_a->channels = av_get_channel_layout_nb_channels(inCodecCtx_a->channel_layout);if (outCodecCtx_a->channel_layout == 0){outCodecCtx_a->channel_layout = AV_CH_LAYOUT_STEREO;outCodecCtx_a->channels = av_get_channel_layout_nb_channels(outCodecCtx_a->channel_layout);}//AV_SAMPLE_FMT_FLTPoutCodecCtx_a->sample_fmt = AV_SAMPLE_FMT_S16P;//outCodecCtx_a->sample_fmt = out_audio_Codec->sample_fmts[0];//AVRational time_base = { 1, inCodecCtx_a->sample_rate };//out_audio_st->time_base = time_base;//AVRational time_base = { 1, ifmt_ctx_audio->streams[in_audioindex]->codecpar->sample_rate };//out_audio_st->time_base = time_base;//out_audioindex = out_audio_st->index;//outCodecCtx_a->time_base = time_base;outCodecCtx_a->codec_tag = 0;if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)outCodecCtx_a->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;if (avcodec_open2(outCodecCtx_a, out_audio_Codec, 0) < 0){//编码器打开失败,退出程序return -1;}avcodec_parameters_from_context(out_audio_st->codecpar,outCodecCtx_a);out_audio_st->codecpar->codec_tag = 0;}if (avio_open(&ofmt_ctx->pb, out_filename, AVIO_FLAG_READ_WRITE) < 0){printf("can not open output file handle!\n");return -1;}if (avformat_write_header(ofmt_ctx, NULL) < 0){printf("can not write the header of the output file!\n");return -1;}//Dump Format------------------av_dump_format(ofmt_ctx, 0, out_filename, 1);
#pragma endregion//prepare before decode and encodeAVPacket *dec_packet = (AVPacket *)av_malloc(sizeof(AVPacket));AVPacket enc_packet;#pragma region prepare image//////AVPacket pkt;//int y_size = oCodecCtx->width * oCodecCtx->height;//av_new_packet(&enc_packet, y_size * 3);//转码上下文struct SwsContext *img_convert_ctx;img_convert_ctx = sws_getContext(inCodecCtx_v->width, inCodecCtx_v->height,inCodecCtx_v->pix_fmt, outCodecCtx_v->width, outCodecCtx_v->height, AV_PIX_FMT_YUV422P, SWS_BICUBIC, NULL, NULL, NULL);struct SwsContext *img_convert_ctx_SDL;img_convert_ctx_SDL = sws_getContext(inCodecCtx_v->width, inCodecCtx_v->height,inCodecCtx_v->pix_fmt, outCodecCtx_v->width, outCodecCtx_v->height, AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);AVFrame	*pFrame_vedio, *pFrameYUV, *pFrameYUV_SDL;pFrameYUV = av_frame_alloc();pFrameYUV_SDL = av_frame_alloc();//设置帧的格式、宽度和高度,否则会出现//1.AVFrame.format is not set//2.AVFrame.width or height is not setpFrameYUV->format = outCodecCtx_v->pix_fmt;pFrameYUV->width = outCodecCtx_v->width;pFrameYUV->height = outCodecCtx_v->height;pFrameYUV_SDL->format = AV_PIX_FMT_YUV420P;pFrameYUV_SDL->width = outCodecCtx_v->width;pFrameYUV_SDL->height = outCodecCtx_v->height;// 存储图像数据uint8_t *out_buffer_vedio;// av_image_get_buffer_size:返回使用给定参数存储图像所需的数据量的字节大小out_buffer_vedio = (uint8_t *)av_malloc(av_image_get_buffer_size(AV_PIX_FMT_YUV422P, outCodecCtx_v->width, outCodecCtx_v->height, 1));// 根据指定的图像参数和提供的数组设置数据指针和线条(data pointers and linesizes)av_image_fill_arrays(pFrameYUV->data, pFrameYUV->linesize, out_buffer_vedio, AV_PIX_FMT_YUV422P, outCodecCtx_v->width, outCodecCtx_v->height, 1);// 存储图像数据uint8_t *out_buffer_SDL;// av_image_get_buffer_size:返回使用给定参数存储图像所需的数据量的字节大小out_buffer_SDL = (uint8_t *)av_malloc(av_image_get_buffer_size(AV_PIX_FMT_YUV420P, outCodecCtx_v->width, outCodecCtx_v->height, 1));// 根据指定的图像参数和提供的数组设置数据指针和线条(data pointers and linesizes)av_image_fill_arrays(pFrameYUV_SDL->data, pFrameYUV_SDL->linesize, out_buffer_SDL, AV_PIX_FMT_YUV420P, outCodecCtx_v->width, outCodecCtx_v->height, 1);#pragma endregion#pragma region prepare Mic//音频参数if (!(fifo = av_audio_fifo_alloc(outCodecCtx_a->sample_fmt, outCodecCtx_a->channels, 1))){fprintf(stderr, "Could not allocate FIFO\n");return AVERROR(ENOMEM);}//Swrstruct SwrContext *au_convert_ctx;au_convert_ctx = swr_alloc();au_convert_ctx = swr_alloc_set_opts(au_convert_ctx,av_get_default_channel_layout(outCodecCtx_a->channels), AV_SAMPLE_FMT_S16P, 44100,av_get_default_channel_layout(inCodecCtx_a->channels), inCodecCtx_a->sample_fmt, inCodecCtx_a->sample_rate,0,NULL);swr_init(au_convert_ctx);//Out Audio Paramuint64_t out_channel_layout = AV_CH_LAYOUT_STEREO;//AAC:1024  MP3:1152int out_nb_samples = inCodecCtx_a->frame_size;//FIX:Some Codec's Context Information is missingint64_t in_channel_layout = av_get_default_channel_layout(inCodecCtx_a->channels);AVFrame	*pFrame_audio, *pFrameMP3;pFrameMP3 = av_frame_alloc();//设置帧的格式、宽度和高度,否则会出现//1.AVFrame.format is not set//2.AVFrame.width or height is not setpFrameMP3->format = outCodecCtx_a->pix_fmt;pFrameMP3->nb_samples = outCodecCtx_a->frame_size;int stream_mapping_size = ifmt_ctx_audio->nb_streams;int *stream_mapping = (int *)av_mallocz_array(stream_mapping_size, sizeof(*stream_mapping));if (!stream_mapping) {ret = AVERROR(ENOMEM);goto end;}
#pragma endregion#if USE_SDL//SDL----------------------------if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) {printf("Could not initialize SDL - %s\n", SDL_GetError());return -1;}int screen_w = 0, screen_h = 0;SDL_Window *screen;screen_w = outCodecCtx_v->width;screen_h = outCodecCtx_v->height;//screen = SDL_SetVideoMode(screen_w, screen_h, 0, 0);//SDL 2.0 Support for multiple windowsscreen = SDL_CreateWindow("Simplest FFmpeg Device", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,screen_w, screen_h, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);if (!screen) {printf("SDL: could not set video mode - exiting:%s\n", SDL_GetError());return -1;}SDL_Texture *sdlTexture;//bmp = SDL_CreateYUVOverlay(pCodecCtx->width, pCodecCtx->height, SDL_YV12_OVERLAY, screen);SDL_Renderer* sdlRenderer = SDL_CreateRenderer(screen, -1, 0);Uint32 pixformat = 0;//IYUV: Y + U + V  (3 planes)//YV12: Y + V + U  (3 planes)pixformat = SDL_PIXELFORMAT_IYUV;sdlTexture = SDL_CreateTexture(sdlRenderer, pixformat, SDL_TEXTUREACCESS_STREAMING, outCodecCtx_v->width, outCodecCtx_v->height);SDL_Rect rect;rect.x = 0;rect.y = 0;rect.w = screen_w;rect.h = screen_h;//SDL End------------------------//------------------------------SDL_Thread *video_tid = SDL_CreateThread(sfp_refresh_thread, NULL, NULL);//SDL_Event event;//SDL_AudioSpec wanted_spec;////SDL_AudioSpec//wanted_spec.freq = 44100;//wanted_spec.format = AUDIO_S16SYS;//wanted_spec.channels = av_get_default_channel_layout(outCodecCtx_a->channels);//wanted_spec.silence = 0;//wanted_spec.samples = out_nb_samples;//wanted_spec.callback = fill_audio;//wanted_spec.userdata = inCodecCtx_a;//if (SDL_OpenAudio(&wanted_spec, NULL)<0) {//	printf("can't open audio.\n");//	return -1;//}
#endif // USE_SDLstart_time = av_gettime();while (1) {//WaitSDL_WaitEvent(&event);if (event.type == SFM_REFRESH_EVENT){av_init_packet(dec_packet);//Get an AVPacketif (av_compare_ts(cur_pts_v, ifmt_ctx_video->streams[in_videoindex]->time_base, cur_pts_a, ifmt_ctx_audio->streams[in_audioindex]->time_base) < 0) {if (cur_pts_v > 10000){thread_exit = 1;}got_frame = -1;got_packet = -1;if (av_read_frame(ifmt_ctx_video, dec_packet) >= 0){if (dec_packet->stream_index == in_videoindex){pFrame_vedio = av_frame_alloc();if (!pFrame_vedio) {printf("alloc pFrame Failed.\n");return -1;}//ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, packet);ret = avcodec_send_packet(inCodecCtx_v, dec_packet);got_frame = avcodec_receive_frame(inCodecCtx_v, pFrame_vedio);if (ret < 0){av_frame_free(&pFrame_vedio);printf("Decode Error.\n");return -1;}if (got_frame == 0){//转码成YUV格式sws_scale(img_convert_ctx, (const unsigned char* const*)pFrame_vedio->data, pFrame_vedio->linesize, 0, inCodecCtx_v->height, pFrameYUV->data, pFrameYUV->linesize);sws_scale(img_convert_ctx_SDL, (const unsigned char* const*)pFrame_vedio->data, pFrame_vedio->linesize, 0, inCodecCtx_v->height, pFrameYUV_SDL->data, pFrameYUV_SDL->linesize);//初始化封装包enc_packet.data = NULL;enc_packet.size = 0;av_init_packet(&enc_packet);//编码//ret = avcodec_encode_video2(oCodecCtx, &enc_packet, pFrameYUV, &got_encpicture);ret = avcodec_send_frame(outCodecCtx_v, pFrameYUV);//FIX : non-strictly-monotonic PTSAVRational time_base_in = { 1, AV_TIME_BASE }; //{ 1, 1000000 };AVRational time_base_conert = outCodecCtx_v->time_base;//{ 1, 1000 };pFrameYUV->pts = av_rescale_q(dec_packet->pts, time_base_in, time_base_conert);if (ret < 0){av_frame_free(&pFrame_vedio);printf("Encode Error.\n");return -1;}got_packet = avcodec_receive_packet(outCodecCtx_v, &enc_packet);if (got_packet == 0){enc_packet.stream_index = out_video_st->index;//FIX:No PTS (Example: Raw H.264)//Simple Write PTSif (enc_packet.pts == AV_NOPTS_VALUE){//Write PTSAVRational time_base1 = ofmt_ctx->streams[out_videoindex]->time_base;//Duration between 2 frames (us)int64_t calc_duration = (double)AV_TIME_BASE / av_q2d(ofmt_ctx->streams[out_videoindex]->r_frame_rate);//Parametersenc_packet.pts = (double)(frame_index*calc_duration) / (double)(av_q2d(time_base1)*AV_TIME_BASE);enc_packet.dts = enc_packet.pts;enc_packet.duration = (double)calc_duration / (double)(av_q2d(time_base1)*AV_TIME_BASE);}if (dec_packet->stream_index == in_videoindex){//DelayAVRational time_base = { 1, AV_TIME_BASE };//{ 1, 1000 };AVRational time_base_q = ofmt_ctx->streams[out_videoindex]->time_base;int64_t pts_time = av_rescale_q(dec_packet->dts, time_base, time_base_q);int64_t now_time = av_rescale_q(av_gettime(), time_base, time_base_q);if (pts_time > now_time)av_usleep(pts_time - now_time);}//Write PTSAVRational time_base = ofmt_ctx->streams[out_videoindex]->time_base;//{ 1, 1000 };AVRational r_framerate1 = ifmt_ctx_video->streams[in_videoindex]->r_frame_rate;// { 50, 2 };AVRational time_base_q = { 1, AV_TIME_BASE };//Duration between 2 frames (us)int64_t calc_duration = (double)(AV_TIME_BASE)*(1 / av_q2d(r_framerate1));	enc_packet.pts = av_rescale_q(frame_index*calc_duration, time_base_q, time_base);enc_packet.dts = enc_packet.pts;enc_packet.duration = av_rescale_q(calc_duration, time_base_q, time_base); //(double)(calc_duration)*(double)(av_q2d(time_base_q)) / (double)(av_q2d(time_base));enc_packet.pos = -1;//Print to Screenif (enc_packet.stream_index == in_videoindex) {frame_index++;printf("%8d Send video frames to output URL\n", frame_index);}cur_pts_v = enc_packet.pts;//写到输出上下文ret = av_interleaved_write_frame(ofmt_ctx, &enc_packet);}av_packet_unref(&enc_packet);							}av_frame_free(&pFrame_vedio);}av_packet_unref(dec_packet);
#if USE_SDL//int y_size = iCodecCtx->width * iCodecCtx->height;////SDL---------------------------//// 设置纹理数据//pFrameYUV_SDL->data[0] = out_buffer;              // Y//pFrameYUV_SDL->data[1] = out_buffer + y_size;      // U //pFrameYUV_SDL->data[2] = out_buffer + y_size * 3 / 2;  // V#if 0SDL_UpdateTexture(sdlTexture, NULL, pFrameYUV->data[0], pFrameYUV->linesize[0]);
#elseSDL_UpdateYUVTexture(sdlTexture, &rect,pFrameYUV_SDL->data[0], pFrameYUV_SDL->linesize[0],pFrameYUV_SDL->data[1], pFrameYUV_SDL->linesize[1],pFrameYUV_SDL->data[2], pFrameYUV_SDL->linesize[2]);
#endif// 清理渲染器SDL_RenderClear(sdlRenderer);// 将纹理数据copy到渲染器//将sdlRect区域的图像显示到dstsdlRect区域//SDL_RenderCopy( sdlRenderer, sdlTexture, &sdlRect, &sdlRect );SDL_RenderCopy(sdlRenderer, sdlTexture, NULL, &rect);// 显示SDL_RenderPresent(sdlRenderer);//SDL End-----------------------
#endif}}else{const int output_frame_size = outCodecCtx_a->frame_size;//int finished = 0;av_init_packet(dec_packet);dec_packet->data = NULL;dec_packet->size = 0;got_frame = -1;got_packet = -1;if (av_read_frame(ifmt_ctx_audio, dec_packet) >= 0){if (dec_packet->stream_index == in_audioindex){pFrame_audio = av_frame_alloc();if (!pFrame_audio) {printf("alloc pFrame Failed.\n");return -1;}if (dec_packet->stream_index >= stream_mapping_size ||stream_mapping[dec_packet->stream_index] < 0) {av_packet_unref(dec_packet);continue;}//ret = avcodec_decode_audio4(inCodecCtx_a, pFrame, &got_picture, packet);int ret = avcodec_send_packet(inCodecCtx_a, dec_packet);got_frame = avcodec_receive_frame(inCodecCtx_a, pFrame_audio);if (ret < 0){av_frame_free(&pFrame_audio);printf("Decode Error.\n");return -1;}if (got_frame == 0){//写入fifowhile (true){int fifo_size = av_audio_fifo_size(fifo);if (fifo_size >= output_frame_size)break;uint8_t **converted_input_samples;converted_input_samples = (uint8_t **)calloc(outCodecCtx_a->channels,sizeof(converted_input_samples));ret = av_samples_alloc(converted_input_samples, NULL,outCodecCtx_a->channels,pFrame_audio->nb_samples,outCodecCtx_a->sample_fmt, 0);//swr_convert(au_convert_ctx, pFrameMP3->data, pFrameMP3->nb_samples, (const uint8_t**)m_ain, pFrame_audio->nb_samples);int conver_num = swr_convert(au_convert_ctx,converted_input_samples, pFrame_audio->nb_samples,(const uint8_t**)pFrame_audio->extended_data, pFrame_audio->nb_samples);ret = av_audio_fifo_realloc(fifo, av_audio_fifo_size(fifo) + pFrame_audio->nb_samples);ret = av_audio_fifo_write(fifo, (void **)converted_input_samples, conver_num);}av_init_packet(&enc_packet);enc_packet.data = NULL;enc_packet.size = 0;float sumlen = av_audio_fifo_size(fifo);int num = 0;//从fifo读出while (true){int fifo_size = av_audio_fifo_size(fifo);if (fifo_size < output_frame_size)break;const int frame_size = FFMIN(av_audio_fifo_size(fifo),outCodecCtx_a->frame_size);AVFrame *covert_frame;covert_frame = av_frame_alloc();covert_frame->nb_samples = output_frame_size;covert_frame->channel_layout = outCodecCtx_a->channel_layout;covert_frame->format = outCodecCtx_a->sample_fmt;covert_frame->sample_rate = outCodecCtx_a->sample_rate;ret = av_frame_get_buffer(covert_frame, 0);ret = av_audio_fifo_read(fifo, (void **)covert_frame->data, frame_size);if (covert_frame) {covert_frame->pts = audio_pts;audio_pts += covert_frame->nb_samples;}ret = avcodec_send_frame(outCodecCtx_a, covert_frame);got_packet = avcodec_receive_packet(outCodecCtx_a, &enc_packet);if (got_packet == 0){frame_index_a++;AVRational timebase = {1,AV_TIME_BASE };int64_t cal_duration = AV_TIME_BASE *(float)covert_frame->nb_samples / (float)covert_frame->sample_rate;enc_packet.pts = av_rescale_q_rnd(audio_pts, outCodecCtx_a->time_base,ofmt_ctx->streams[out_audio_st->index]->time_base,(AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));enc_packet.dts = enc_packet.pts;enc_packet.duration = av_rescale_q_rnd(cal_duration, timebase,ofmt_ctx->streams[out_audio_st->index]->time_base,(AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));//int64_t cal_duration = AV_TIME_BASE *(float)covert_frame->nb_samples / (float)covert_frame->sample_rate;//enc_packet.pos = -1;//enc_packet.pts = frame_index_a*cal_duration;//enc_packet.dts = enc_packet.pts;//enc_packet.duration = cal_duration;AVRational time_base = ofmt_ctx->streams[out_audioindex]->time_base;//{ 1, 1000 };AVRational time_base_q = { 1, AV_TIME_BASE };//Delayint64_t pts_time = av_rescale_q(enc_packet.pts, time_base, time_base_q);int64_t now_time = av_gettime() - start_time;if (pts_time > now_time)av_usleep(pts_time - now_time);//Print to Screenif (enc_packet.stream_index == in_audioindex){printf("Send %8d audio frames to output URL\n", frame_index_a);}cur_pts_a = enc_packet.pts;ret = av_interleaved_write_frame(ofmt_ctx, &enc_packet);}av_frame_free(&covert_frame);}av_packet_unref(&enc_packet);av_packet_unref(dec_packet);av_frame_free(&pFrame_audio);}}}av_packet_unref(dec_packet);}}else if (event.type == SDL_QUIT){thread_exit = 1;}else if(event.type == SFM_BREAK_EVENT){break;}}SDL_Quit();//写文件尾(Write file trailer)av_write_trailer(ofmt_ctx);//av_free(out_buffer_vedio);//av_free(out_buffer_audio);end:if (out_video_st)avcodec_close(outCodecCtx_v);if (out_audio_st)avcodec_close(outCodecCtx_a);avformat_close_input(&ifmt_ctx_video);avformat_close_input(&ifmt_ctx_audio);/* close output */if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE))avio_close(ofmt_ctx->pb);avformat_free_context(ifmt_ctx_video);avformat_free_context(ifmt_ctx_audio);avformat_free_context(ofmt_ctx);if (ret < 0 && ret != AVERROR_EOF) {printf("Error occurred.\n");return -1;}return 0;
}

 

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. Hadoop编译源码(面试重点)

    昨天开始编译的,也不算是踩坑。跟着尚硅谷教程走的,直接分享一下老师的笔记吧。提个醒,编译过程有几次一直出现“-------”这玩意,不代表完成了,要等到后面那张图才代表完事了。我编译了大概90分钟,按教程搞,一遍过。再说点吧,教程是这么操作的,root用户,在"/op…...

    2024/4/24 9:45:57
  2. 阿里云“在家实践”计划测试题答案(部分)

    因新冠肺炎疫情,学校延期开学。在家时间不浪费,提高技能好机会。阿里云弹性计算联合开发者社区,推出高校“在家实影”计划,全国高校学生,每人可免领取一台云服务器ECS算力资源,在线实践影课程等资源。 阿里云高校——学生“在家实践”计划MyBlog:阿里云在家实践计划测试题…...

    2024/5/8 12:54:23
  3. EfficientPS论文翻译-------第二部分:相关工作

    EfficientPS: Efficient Panoptic Segmentation论文翻译-------第二部分:相关工作 全景分割是最近提出的一个场景理解问题(Kirillov et al, 2019),它统一了语义分割和实例分割的任务。对于这些子任务,已经提出了许多方法,但是只有少数方法被引入来处理全景分割的连贯场景理…...

    2024/4/24 9:45:57
  4. MPP update优化一

    前言:对于列式存储直接update性能低下,可采用update+insert方式或者delete+insert 方式 实现更新操作例子:套牌车的一个测试例子drop table dts_vehicle_resource.fake_plate_info_sp; drop table viid_vehicle.vehiclestructured_kafka_sp; drop table dts_vehicle_resourc…...

    2024/4/24 9:45:54
  5. AOP序列化目标方法参数时报错

    问题:ServletRequest、ServletResponse不能被序列化使用google.gson会OOM使用alibaba.fastjson会抛出非法参数异常原因:ServletRequest、ServletResponse是Interface解决方案:private Object[] excludeJoinPointArgs(JoinPoint joinPoint) {Object[] args = joinPoint.getAr…...

    2024/5/8 14:10:10
  6. 查看iOS APP Bundle ID 报错 Could not connect to lockdownd. Exiting.

    IOS APP Bundle ID是APP的唯一标识,以下简称BID,可以用ideviceinstaller -l查看。 最近用此命令查看的时候报错了: Could not connect to lockdownd. Exiting.查了一些资料后,发现是因为很多依赖库太老了,更新一下就可以了。 本文使用的macOS版本是10.15.5。 # 更新brew b…...

    2024/5/8 19:39:10
  7. 饱和度和明度

    饱和度:指颜色的纯度或强度,简单点理解就是颜色中的灰色量含量的高低。明度:指的是颜色中混合了多少白色或黑色。 饱和度、明度越高,视觉冲击力越强烈;饱和度、明度较低的时候,视觉上越温和。高级感的色彩是克制的,表现的精致、稳重、具有品质感。低饱和、低明度的摄影作…...

    2024/5/8 13:05:37
  8. uni-app 修改组件默认样式

    修改 uni-app 组件默认样式 转载做下记录 切记类似于微信原生的,颜色不能修改有平台差异性。 最近刚开始使用uniapp开发,有些组件渲染之后会生成一些标签,我需要修改生成标签的样式。 直接写: <style scoped>.uni-combox__input {font-size: 14px;} </style>无…...

    2024/4/24 9:45:50
  9. 《数据结构与算法指南》01:算法概述汇总

    内容导航:前言 1、何谓算法 2、算法的特征 3、算法的发展历史 4、算法的分类 5、算法相关概念 6、算法的表示法 7、算法性能评估 8、简单案例前言 夸张点说,如果有人因为说过一句话而被授予图灵奖、计算机科学教育杰出贡献奖、Emanual Piore奖和计算机先驱奖,您是不是很惊讶…...

    2024/5/6 16:25:14
  10. DVWA——Brute Force暴力破解(Medium)

    DVWA——Brute Force 暴力破解 Low.学习源码 <?phpif( isset( $_GET[ Login ] ) ) {// Sanitise username input$user = $_GET[ username ];$user = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysql…...

    2024/4/24 9:45:48
  11. Opencv中rectangle函数与Rect函数的用法

    rectangle函数是用来绘制一个矩形框的,通常用在图片的标记上。 1.rectangle(img2, Point(j,i), Point(j + img4.cols, i + img4.rows), Scalar(255, 255, 0), 2, 8);img2:被处理的图片 Point(j,i)代表矩形左上点的坐标 Point(j + cols, i + rows)代表矩形右下点的坐标【矩形的…...

    2024/4/24 9:45:50
  12. ViewDragHelper实战,实现滑动解锁

    说到滑动解锁,就回到了2012~2014年,iPhone4S、5、5S年代,如今准备踏入2020年,这些年国产机崛起,再也不是公交车上都是iPhone4S的场景。本篇来使用ViewDragHelper实现滑动解锁。成品展示先来分析一下页面的元素背景图圆角滑道圆形滑块闪动提示文字 其他一些细节:滑道和圆形…...

    2024/4/24 9:45:53
  13. 首款国产开源数据库TBase核心架构演进

    腾讯云数据库国产数据库专题线上技术沙龙正在火热进行中,4月14日李跃森的分享已经结束,没来得及参与的小伙伴不用担心,以下就是直播的视频和文字回顾。关注“腾讯云数据库”公众号,回复“0414李跃森”,即可下载直播分享PPT。大家好,我是李跃森,目前负责腾讯云TBase数据库…...

    2024/4/17 16:14:48
  14. Android - Button 添加事件的3中方法

    一 、监听器:监听器是一个存在于View类下的接口,一般以On******Llistener命名,实现该接口需要复写相应的on****(View v)方法(如onClick(View v))二、监听器的三种实现方法1、利用布局文件中的onClick属性,并在实现文件中实现该方法。注意的是这里的方法名应该和布局文件中…...

    2024/4/18 16:27:51
  15. 单片机(MCU)最强科普(万字总结,值得收藏)

    MCU是Microcontroller Unit 的简称,中文叫微控制器,俗称单片机,是把CPU的频率与规格做适当缩减,并将内存、计数器、USB、A/D转换、UART、PLC、DMA等周边接口,甚至LCD驱动电路都整合在单一芯片上,形成芯片级的计算机,为不同的应用场合做不同组合控制,诸如手机、PC外围、…...

    2024/4/16 9:51:37
  16. [斗鱼]没人比我更懂微服务--Go微服务框架Jupiter

    作者:aerox@斗鱼 项目开源地址:https://github.com/douyu/jupiter Jupiter 是斗鱼开源的,面向服务治理的Golang微服务框架,以开发效率和治理效率为核心目标,从统一开发规范、完善监控埋点、降低开发难度等多个维度来帮助Gopher开发高性能、高可靠性的微服务框架。 Jupiter…...

    2024/4/16 19:58:14
  17. Java小游戏-飞机大战(FunnyTopGun)

    效果图:游戏窗口有两个,一个类似于登录界面,点击屏幕跳转到另一个主窗口。WASD控制上下左右,空格键攻击。只用单一的主窗口线程的话键盘不能同时响应移动和攻击事件,所以创建多线程来控制事件发生:PaintThread pt = new PaintThread(); //画图线程MyBulletThread bt = n…...

    2024/4/24 9:45:45
  18. 如何联系CSDN客服

    如何联系CSDN客服 好久没写过东西了,最近想写,奈何总提示账号异常,登录不了,找半天才找到CSDN客服,感谢CSDN客服如何联系,CSDN帐号异常解决方法博文以及评论,感谢 客服qq:800180106 加上之后,客服大大说就在首页,我……...

    2024/4/24 9:45:45
  19. BIRT 异构跨库的动态关联查询怎么做

    BIRT自带的Data Sources Join以及用ETL转化为同库等方案都难以解决此类问题。具体可以通过如下示例讨论:交易明细数据(trade表)存储于生产系统的数据库DB2中,另外一部分业务数据(network表、account表)存储于业务系统的Mysql中,它们其中的关联关系如下图所示:所谓“动态关联…...

    2024/4/24 9:45:51
  20. shell 输出系统某几个服务状态和某几个版本版本

    cat server_version.sh #!/bin/bash ##输出系统某几个服务状态和某几个版本版本 ##变量 system=systemctl status system_name="neutron-linuxbridge-agent.service openstack-nova-api.service openstack-glance-api.service openstack-nova-compute.service mariadb.s…...

    2024/4/24 9:45:49

最新文章

  1. Java毕业设计 基于SpringBoot vue社区智慧养老监护管理平台

    Java毕业设计 基于SpringBoot vue社区智慧养老监护管理平台 SpringBoot 社区智慧养老监护管理平台 功能介绍 登录注册 个人中心 修改密码 个人信息 房间信息管理 房间入住信息管理 反馈信息管理 留言管理 老人信息管理 公告管理 物资申请管理 管理员管理 护工管理 体检员管理…...

    2024/5/8 21:24:30
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/5/7 10:36:02
  3. C语言面试题之合法二叉搜索树

    合法二叉搜索树 实例要求 实现一个函数&#xff0c;检查一棵二叉树是否为二叉搜索树&#xff1b; 示例 1: 输入:2/ \1 3 输出: true 示例 2: 输入:5/ \1 4/ \3 6 输出: false 解释: 输入为: [5,1,4,null,null,3,6]。根节点的值为 5 &#xff0c;但是其右子节点值为 4 …...

    2024/4/30 11:24:24
  4. 汽车疲劳测试试验平台技术要求(北重厂家)

    汽车疲劳测试试验平台技术要求通常包括以下几个方面&#xff1a; 车辆加载能力&#xff1a;测试平台需要具备足够的承载能力&#xff0c;能够同时测试多种车型和不同重量的车辆。 动力系统&#xff1a;测试平台需要具备稳定可靠的动力系统&#xff0c;能够提供足够的力和速度来…...

    2024/5/8 14:02:58
  5. STL--vector有哪些应用场景

    vector 在 C 中是一种非常灵活和强大的容器&#xff0c;适用于多种不同的应用场景。以下是一些常见的应用场景&#xff1a; 1 动态数据集合&#xff1a;当你不确定数据集的大小&#xff0c;或者数据集的大小会随时间变化时&#xff0c;vector 是理想的选择。例如&#xff0c;在…...

    2024/5/8 15:27:48
  6. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/8 6:01:22
  7. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/7 9:45:25
  8. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  9. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/7 14:25:14
  10. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  11. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  12. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  13. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/7 11:36:39
  14. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  15. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  16. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  17. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/8 20:48:49
  18. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/7 9:26:26
  19. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  20. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/8 19:33:07
  21. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  22. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/8 20:38:49
  23. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  24. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/6 21:42:42
  25. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/4 23:54:56
  26. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  27. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  28. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  29. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  30. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  31. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  32. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  33. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  34. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  35. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  36. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  37. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  38. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  39. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  40. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  41. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  42. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  43. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  44. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  45. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57