i have ip-cam mjpeg that i made and it have total 240 frames
encode souce is ffmpeg.exe -framerate 25 -i c:\%06d.jpg\ -s 1920x1080 -qscale 1 -vcodec mjpeg -r 25 C:\result.mjpg -y
now i want to play result.mjpg by mjpeg player i made
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
below is ffprobe result
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
below is result added -show_frame
[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 me there are Duration: N/A, bitrate: N/A
how do i set Duration and bitrate is there any encode-option i have to set ?
when i decode mjpeg like below
i can't get duration just 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