diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 67b5819..a816ac5 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -39,6 +39,12 @@ typedef struct {
     int updatefirst;
 } VideoMuxData;
 
+#define URL_SCHEME_CHARS                        \
+    "abcdefghijklmnopqrstuvwxyz"                \
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"                \
+    "0123456789+-."
+
+
 static int write_header(AVFormatContext *s)
 {
     VideoMuxData *img = s->priv_data;
@@ -74,6 +80,14 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(codec->pix_fmt);
     int i;
 
+	if(strstr(img->path, "concat"))
+	{
+		size_t proto_len = strspn(img->path, URL_SCHEME_CHARS);
+
+		if(img->path[proto_len] == ':')
+			img->path[proto_len] = '_';		
+	}
+
     if (!img->is_pipe) {
         if (av_get_frame_filename(filename, sizeof(filename),
                                   img->path, img->img_number) < 0 && img->img_number > 1 && !img->updatefirst) {
