2014-10-10 1 views
0

어떻게 만드는 MJPEG MJPEG하는 기간 또는 추가하는 방법을 빨리

인코딩 소스도는 ffmpeg.exe 25 -ic -framerate 내가 만든 IP 캠 MJPEG을하고 총 240 프레임

이입니다 I : \ % 06d.jpg \ -s 1920 × 1080 -qscale 1 -vcodec MJPEG -r (25)는 C : \ result.mjpg -y

지금 내가 MJPEG 플레이어가 result.mjpg을 재생하려면 내가 아래

my problem 
1. i can't get mjpeg's play time or duration time 

2. playing is slower then other movie player so i want to sync it and play more faster 

했다 ffprobe 결과입니다

/A, 비트 레이트 N : N/A 내가 기간 및 비트 레이트를 설정 어떻게

이가 어떤 아래

Input #0, mjpeg, from 'result.mjpg': 
Duration: N/A, bitrate: N/A 
Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg), 1920x1080, 25 tbr, 1200k tbn, 25 tbc 

[FRAME] 
media_type=video 
key_frame=1 
pkt_pts=720000 
pkt_pts_time=0.600000 
pkt_dts=720000 
pkt_dts_time=0.600000 
best_effort_timestamp=720000 
best_effort_timestamp_time=0.600000 
pkt_duration=48000 
pkt_duration_time=0.040000 
pkt_pos=4731406 
pkt_size=313289 
width=1920 
height=1080 
pix_fmt=yuvj444p 
sample_aspect_ratio=333:320 
pict_type=I 
coded_picture_number=0 
display_picture_number=0 
interlaced_frame=0 
top_field_first=0 
repeat_pict=0 
[/FRAME] 

ffprobe이 기간이 있습니다 보여줘 결과가 -show_frame에게

을 추가입니다 인코딩 설정 옵션을 설정해야합니까? 내가 MJPEG

아래 내가 얻을 수없는 것처럼 시간을 디코딩 할 때

단지 0

AVFormatContext* pFC; 
int    ret; 

pFC = avformat_alloc_context(); 

ret = avformat_open_input(&pFC, filename, NULL, NULL); 
if (ret < 0) { 
    // fail . 
} 

ret = avformat_find_stream_info(pFC, NULL); 
if (ret < 0) { 
    // fail 
} 
printf("duration %ld", pFC->duration); <----- only 0 

답변

0

내가 더 빨리 것 같다 을 SWS_FAST_BILINEAR하는 SWS_BICUBIC fromn 옵션을 변경하고 내 질문이 이루어집니다

static int sws_flags = SWS_BICUBIC; 
struct SwsContext *img_convert_ctx; 
img_convert_ctx = sws_getContext( pVCtx->width, 
            pVCtx->height, 
            pVCtx->pix_fmt, 
            pVCtx->width, 
            pVCtx->height, 
            PixelFormat::PIX_FMT_BGR24, 
            sws_flags, NULL, NULL, NULL) 


static int sws_flags = SWS_FAST_BILINEAR; 
struct SwsContext *img_convert_ctx; 
img_convert_ctx = sws_getContext( pVCtx->width, 
            pVCtx->height, 
            pVCtx->pix_fmt, 
            pVCtx->width, 
            pVCtx->height, 
            PixelFormat::PIX_FMT_BGR24, 
            sws_flags, NULL, NULL, NULL); 
관련 문제