[FFmpeg-trac] #6444(undetermined:new): libavformat segment format

FFmpeg trac at avcodec.org
Tue Jun 6 18:56:32 EEST 2017


#6444: libavformat segment format
-------------------------------------+-------------------------------------
             Reporter:  sante85      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 How to reproduce:
 {{{
 % ffmpeg -f rtsp -i rtsp://localhost:1935/live/d2000 -f segment
 -segment_format webm -strftime 1 -segment_time 60 -force_key_frames
 "expr:gte(t,n_forced*60)" -segment_start_number 36 -segment_time_delta
 0.01 -reset_timestamps 1 -c:v copy -c:a copy
 /usr/local/d2000_rec_%s%3S_%1d.webm

 ffmpeg release 3.3

 }}}
 i want format segment name with double format (timestamp + counter)
 I expect that generated name are:
 /usr/local/d2000_rec_1496763553013_36.webm

 we remove '} else if {'

 Best Regards

 -------
 static int set_segment_filename(AVFormatContext *s)
 ......

 if (seg->use_strftime) {
         time_t now0;
         struct tm *tm, tmpbuf;
         time(&now0);
         tm = localtime_r(&now0, &tmpbuf);
         if (!strftime(oc->filename, sizeof(oc->filename), s->filename,
 tm)) {
             av_log(oc, AV_LOG_ERROR, "Could not get segment filename with
 strftime\n");
             return AVERROR(EINVAL);
         }
     } else if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
                                      s->filename, seg->segment_idx) < 0) {
         av_log(oc, AV_LOG_ERROR, "Invalid segment filename template
 '%s'\n", s->filename);
         return AVERROR(EINVAL);
     }
 .....

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6444>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list