强奸久久久久久久|草草浮力在线影院|手机成人无码av|亚洲精品狼友视频|国产国模精品一区|久久成人中文字幕|超碰在线视屏免费|玖玖欧洲一区二区|欧美精品无码一区|日韩无遮一区二区

首頁(yè) > 資訊 > 知識(shí) > ffmpeg推流,F(xiàn)FMPEG推送視頻流WIN10報(bào)錯(cuò)RTMPConnect0 failed to

ffmpeg推流,F(xiàn)FMPEG推送視頻流WIN10報(bào)錯(cuò)RTMPConnect0 failed to

來(lái)源:整理 時(shí)間:2023-08-21 20:40:08 編輯:智能門戶 手機(jī)版

本文目錄一覽

1,F(xiàn)FMPEG推送視頻流WIN10報(bào)錯(cuò)RTMPConnect0 failed to

這個(gè)一般都是因?yàn)閞tmp服務(wù)器沒(méi)有啟動(dòng)導(dǎo)致的
同問(wèn)。。。

FFMPEG推送視頻流WIN10報(bào)錯(cuò)RTMPConnect0 failed to

2,如何使用ffmpeg實(shí)現(xiàn)h264流傳輸H264實(shí)現(xiàn)RTP傳輸數(shù)據(jù)

H264編碼后,就可以逐個(gè)NAL做RTP打包,接收端RTP解包,然后H264解碼,渲染了。FFMPEG應(yīng)該可以實(shí)現(xiàn)。

如何使用ffmpeg實(shí)現(xiàn)h264流傳輸H264實(shí)現(xiàn)RTP傳輸數(shù)據(jù)

3,ffmpeg通過(guò)UDP協(xié)議將編碼后的流發(fā)送到局域網(wǎng)電腦的某個(gè)端口上

udp://192.168.1.114:30001114后面不是/ 而是:
我是來(lái)看評(píng)論的

ffmpeg通過(guò)UDP協(xié)議將編碼后的流發(fā)送到局域網(wǎng)電腦的某個(gè)端口上

4,安卓怎么利用ffmpeg把視屏轉(zhuǎn)化為ftsp流上傳到服務(wù)器

ffmpeg -i rtmp://*******(源地址) -c:v copy -c:a copy -f flv -y rtmp://*******(服務(wù)器地址)

5,如何獲取ffmpeg實(shí)時(shí)轉(zhuǎn)流速度

static void probe(AVProbeData *pd, int type, int p, int size){ int i = 0; AVInputFormat *fmt = NULL; while ((fmt = av_iformat_next(fmt))) { if (fmt->flags & AVFMT_NOFILE) continue; if (fmt->read_probe) { int score = fmt->read_probe(pd); if (score > score_array[i] && score > AVPROBE_SCORE_MAX / 4) { score_array[i] = score; fprintf(stderr, "Failure of %s probing code with score=%d type=%d p=%X size=%d\n", fmt->name, score, type, p, size); failures++; } } i++; }}
沒(méi)看懂什么意思?

6,ffmpeg怎么樣處理網(wǎng)絡(luò)流

#include "utils.h"#include <pthread.h>#include <libavcodec/avcodec.h>#include <libavformat/avformat.h>UdpQueue recvqueue;UdpParam udpParam;//注冊(cè)av_read_frame的回調(diào)函數(shù),這里只是最簡(jiǎn)處理,實(shí)際應(yīng)用中應(yīng)加上出錯(cuò)處理,超時(shí)等待...int read_data(void *opaque, uint8_t *buf, int buf_size) int size = buf_size;int ret;// printf("read data %d\n", buf_size);do ret = get_queue(&recvqueue, buf, buf_size);} while (ret);// printf("read data Ok %d\n", buf_size);return size;}#define BUF_SIZE 4096*500int main(int argc, char** argv) init_queue(&recvqueue, 1024*500);udpParam.argv = argv;udpParam.queue = &recvqueue;uint8_t *buf = av_mallocz(sizeof(uint8_t)*BUF_SIZE);//UDP接收線程pthread_t udp_recv_thread;pthread_create(&udp_recv_thread, NULL, udp_ts_recv, &udpParam);pthread_detach(udp_recv_thread);av_register_all();AVCodec *pVideoCodec, *pAudioCodec;AVCodecContext *pVideoCodecCtx = NULL;AVCodecContext *pAudioCodecCtx = NULL;AVIOContext * pb = NULL;AVInputFormat *piFmt = NULL;AVFormatContext *pFmt = NULL;//step1:申請(qǐng)一個(gè)AVIOContextpb = avio_alloc_context(buf, BUF_SIZE, 0, NULL, read_data, NULL, NULL);if (!pb) fprintf(stderr, "avio alloc failed!\n");return -1;}//step2:探測(cè)流格式if (av_probe_input_buffer(pb, &piFmt, "", NULL, 0, 0) < 0) fprintf(stderr, "probe failed!\n");return -1;} else fprintf(stdout, "probe success!\n");fprintf(stdout, "format: %s[%s]\n", piFmt->name, piFmt->long_name);}pFmt = avformat_alloc_context();pFmt->pb = pb; //step3:這一步很關(guān)鍵//step4:打開(kāi)流if (avformat_open_input(&pFmt, "", piFmt, NULL) < 0) fprintf(stderr, "avformat open failed.\n");return -1;} else fprintf(stdout, "open stream success!\n");}//以下就和文件處理一致了if (av_find_stream_info(pFmt) < 0) fprintf(stderr, "could not fine stream.\n");return -1;}av_dump_format(pFmt, 0, "", 0);int videoindex = -1;int audioindex = -1;for (int i = 0; i < pFmt->nb_streams; i++) if ( (pFmt->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&(videoindex < 0) ) videoindex = i;}if ( (pFmt->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) &&(audioindex < 0) ) audioindex = i;}}if (videoindex < 0 || audioindex < 0) fprintf(stderr, "videoindex=%d, audioindex=%d\n", videoindex, audioindex);return -1;}AVStream *pVst,*pAst;pVst = pFmt->streams[videoindex];pAst = pFmt->streams[audioindex];pVideoCodecCtx = pVst->codec;pAudioCodecCtx = pAst->codec;pVideoCodec = avcodec_find_decoder(pVideoCodecCtx->codec_id);if (!pVideoCodec) fprintf(stderr, "could not find video decoder!\n");return -1;}if (avcodec_open(pVideoCodecCtx, pVideoCodec) < 0) fprintf(stderr, "could not open video codec!\n");return -1;}pAudioCodec = avcodec_find_decoder(pAudioCodecCtx->codec_id);if (!pAudioCodec) fprintf(stderr, "could not find audio decoder!\n");return -1;}if (avcodec_open(pAudioCodecCtx, pAudioCodec) < 0) fprintf(stderr, "could not open audio codec!\n");return -1;}int got_picture;uint8_t samples[AVCODEC_MAX_AUDIO_FRAME_SIZE*3/2];AVFrame *pframe = avcodec_alloc_frame();AVPacket pkt;av_init_packet(&pkt);while(1) if (av_read_frame(pFmt, &pkt) >= 0) if (pkt.stream_index == videoindex) fprintf(stdout, "pkt.size=%d,pkt.pts=%lld, pkt.data=0x%x.", pkt.size, pkt.pts,(unsigned int)pkt.data);avcodec_decode_video2(pVideoCodecCtx, pframe, &got_picture, &pkt);if (got_picture) fprintf(stdout, "decode one video frame!\n");}}else if (pkt.stream_index == audioindex) int frame_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*3/2;if (avcodec_decode_audio3(pAudioCodecCtx, (int16_t *)samples, &frame_size, &pkt) >= 0) fprintf(stdout, "decode one audio frame!\n");}}av_free_packet(&pkt);}}av_free(buf);av_free(pframe);free_queue(&recvqueue);return 0;}
文章TAG:ffmpeg推流FFMPEG推送視頻流WIN10報(bào)錯(cuò)RTMPConnect0failedto

最近更新

相關(guān)文章

知識(shí)文章排行榜