- if (!img->is_pipe) {
- if (img->update) {
- av_strlcpy(filename, img->path, sizeof(filename));
- } else if (img->use_strftime) {
- time_t now0;
- struct tm *tm, tmpbuf;
- time(&now0);
- tm = localtime_r(&now0, &tmpbuf);
- if (!strftime(filename, sizeof(filename), img->path, tm)) {
- av_log(s, AV_LOG_ERROR, "Could not get frame filename with strftime\n");
- return AVERROR(EINVAL);
- }
- } else if (img->frame_pts) {
- if (av_get_frame_filename2(filename, sizeof(filename), img->path, pkt->pts, AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0) {
- av_log(s, AV_LOG_ERROR, "Cannot write filename by pts of the frames.");
- return AVERROR(EINVAL);
- }
- } else if (av_get_frame_filename2(filename, sizeof(filename), img->path,
- img->img_number,
- AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0 &&
- img->img_number > 1) {
- av_log(s, AV_LOG_ERROR,
- "Could not get frame filename number %d from pattern '%s'. "
- "Use '-frames:v 1' for a single image, or '-update' option, or use a pattern such as %%03d within the filename.\n",
- img->img_number, img->path);
+ if (img->update) {
+ av_strlcpy(filename, img->path, sizeof(filename));
+ } else if (img->use_strftime) {
+ time_t now0;
+ struct tm *tm, tmpbuf;
+ time(&now0);
+ tm = localtime_r(&now0, &tmpbuf);
+ if (!strftime(filename, sizeof(filename), img->path, tm)) {
+ av_log(s, AV_LOG_ERROR, "Could not get frame filename with strftime\n");