How to set reset_timestamps with FFMPEG C/C++ -
i save rtsp stream mp4 video file every minute. problem when new video created, start time not close 0, increases continously, here's out put of video ffprobe:
input #0, mov,mp4,m4a,3gp,3g2,mj2, './2017/8/15/8/56/56.mp4': metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : lavf57.41.100 duration: 00:01:00.28, start: 60.247005, bitrate: 2244 kb/s stream #0:0(und): video: h264 (main) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1280x720 [sar 1:1 dar 16:9], 2243 kb/s, 14.91 fps, 25 tbr, 15360 tbn, 30 tbc (default) metadata: handler_name : videohandler
you can see start value 60.247005. when use ffmpeg command line , add option 'reset_timestamps' work, start value close 0, , if remove 'reset_timestamps' output videos code..here's command use:
ffmpeg -i rtsp://usr:pass@ipaddress/streaming/channels/1?tcp -c copy -map 0 -f segment -segment_time 20 -segment_format mp4 -reset_timestamps 1 "capture-%03d.mp4"
so, hope can set option reset_timestamps in code, seem can't. try no luck:
avdictionary* opts = null; av_dict_set(&opts, "reset_timestamps", "1", 0); avformat_write_header(ofmt_ctx, &opts);
code posted in previous question: how set start time of video saved rtsp stream ffmpeg
anyone knows how that? thanks.
Comments
Post a Comment