Re: [FFmpeg-devel] FFMpeg media concatenation issue

2022-12-13 Thread jb



Am 14.12.22 um 07:22 schrieb Sagar Upadhyay:

Preview attachment ffmpegerror.PNG
ffmpegerror.PNG
85 KB
Hello,

I am using FFmpeg for concatenating videos, images, background images, and
set background audio.
I have done all things and it's working on my system but while I am using
the same command on another system and on the server, it's showing me
stream related error.

Can you please help me with this issue?

I've attached a screenshot of the error message which I'm getting.


Hello,

I think is better and more save to specify the streams correctly, with 
[0:v] | [0:a] | [1:v] | [1:a] and so on. This is also the way in the 
documentation: https://ffmpeg.org/ffmpeg-filters.html#concat





Thanks & Regards
Sagar Upadhyay
*Abbacus Technologies*
Skype: live:.cid.15b5ae379d6c78b7
UK: +44 207 193 3428 <+442071933428> | US: +1 201 204 9318 <+12012049318>
IND: +91 79 400 500 60 <+917940050060>
 WEB 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] libavformat/rtmp: Adding a flag to give user the option to have ffmpeg fail instead of warn when mismatches are found in rtmp url stream or application names.

2022-03-28 Thread jb

Hello,

this patch was originally from William Martin, I just adapt it to the 
newest ffmpeg version.


Regards

Jonathan
From 89b441ce47614035a545da1a7ce46c53ccf165e5 Mon Sep 17 00:00:00 2001
From: jb-alvarado 
Date: Mon, 28 Mar 2022 17:07:57 +0200
Subject: [PATCH] Adding a flag to give user the option to have ffmpeg fail
 instead of warn when mismatches are found in rtmp url stream or application
 names.

from original:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20190925185708.70924-1-unique.will.mar...@gmail.com/
---
 libavformat/librtmp.c   |  2 ++
 libavformat/rtmpproto.c | 28 ++--
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 43013e4..00b4966 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -52,6 +52,7 @@ typedef struct LibRTMPContext {
 int live;
 char *temp_filename;
 int buffer_size;
+bool strict_paths;
 } LibRTMPContext;

 static void rtmp_log(int level, const char *fmt, va_list args)
@@ -333,6 +334,7 @@ static const AVOption options[] = {
 {"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
 {"rtmp_swfverify", "URL to player swf file, compute hash/size automatically. (unimplemented)", OFFSET(swfverify), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
 {"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+{"rtmp_strict_paths", "Error instead of warn for mismatch on stream or application path in url", OFFSET(strict_paths), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, DEC},
 #if CONFIG_NETWORK
 {"rtmp_buffer_size", "set buffer size in bytes", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, DEC|ENC },
 #endif
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f97e3c3..34433ed 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -132,6 +132,7 @@ typedef struct RTMPContext {
 char  auth_params[500];
 int   do_reconnect;
 int   auth_tried;
+int   strict_paths;   ///< If true, enforce strict string matching on rtmp stream and application
 } RTMPContext;

 #define PLAYER_KEY_OPEN_PART_LEN 30   ///< length of partial key used for first client digest signing
@@ -480,9 +481,16 @@ static int read_connect(URLContext *s, RTMPContext *rt)
  "app", tmpstr, sizeof(tmpstr));
 if (ret)
 av_log(s, AV_LOG_WARNING, "App field not found in connect\n");
-if (!ret && strcmp(tmpstr, rt->app))
-av_log(s, AV_LOG_WARNING, "App field don't match up: %s <-> %s\n",
-   tmpstr, rt->app);
+if (!ret && strcmp(tmpstr, rt->app)) {
+if (rt->strict_paths) {
+av_log(s, AV_LOG_ERROR, "App field don't match up: %s <-> %s. "
+   "Exiting since rtmp_strict_paths provided\n", tmpstr, rt->app);
+return AVERROR(EIO);
+} else {
+av_log(s, AV_LOG_WARNING, "App field don't match up: %s <-> %s\n",
+tmpstr, rt->app);
+}
+}
 ff_rtmp_packet_destroy(&pkt);

 // Send Window Acknowledgement Size (as defined in specification)
@@ -1947,9 +1955,16 @@ static int send_invoke_response(URLContext *s, RTMPPacket *pkt)
 pchar = s->filename;
 }
 pchar++;
-if (strcmp(pchar, filename))
-av_log(s, AV_LOG_WARNING, "Unexpected stream %s, expecting"
-   " %s\n", filename, pchar);
+if (strcmp(pchar, filename)) {
+if (rt->strict_paths) {
+av_log(s, AV_LOG_ERROR, "Unexpected stream %s, expecting %s. "
+"Exiting since rtmp_strict_paths provided.\n", filename, pchar);
+return AVERROR(EIO);
+} else {
+av_log(s, AV_LOG_WARNING, "Unexpected stream %s, expecting"
+" %s\n", filename, pchar);
+}
+}
 }
 rt->state = STATE_RECEIVING;
 }
@@ -3119,6 +3134,7 @@ static const AVOption rtmp_options[] = {
 {"listen",  "Listen for incoming rtmp connections", OFFSET(listen), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtmp_listen" },
 {"tcp_nodelay", "Use TCP_NODELAY to disable Nagle's algorithm", OFFSET(tcp_nodelay), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC|ENC},
 {"timeout", "Maximum timeout (in

[FFmpeg-devel] [PATCH] libavformat/rtmp: Adding a flag to give user the option to have ffmpeg fail instead of warn when mismatches are found in rtmp url stream or application names.

2022-03-28 Thread jb

Hello,

this patch was originally from William Martin, I just adapt it to the 
newest ffmpeg version.


Regards

Jonathan
From 89b441ce47614035a545da1a7ce46c53ccf165e5 Mon Sep 17 00:00:00 2001
From: jb-alvarado 
Date: Mon, 28 Mar 2022 17:07:57 +0200
Subject: [PATCH] Adding a flag to give user the option to have ffmpeg fail
 instead of warn when mismatches are found in rtmp url stream or application
 names.

from original:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20190925185708.70924-1-unique.will.mar...@gmail.com/
---
 libavformat/librtmp.c   |  2 ++
 libavformat/rtmpproto.c | 28 ++--
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 43013e4..00b4966 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -52,6 +52,7 @@ typedef struct LibRTMPContext {
 int live;
 char *temp_filename;
 int buffer_size;
+bool strict_paths;
 } LibRTMPContext;

 static void rtmp_log(int level, const char *fmt, va_list args)
@@ -333,6 +334,7 @@ static const AVOption options[] = {
 {"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
 {"rtmp_swfverify", "URL to player swf file, compute hash/size automatically. (unimplemented)", OFFSET(swfverify), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
 {"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+{"rtmp_strict_paths", "Error instead of warn for mismatch on stream or application path in url", OFFSET(strict_paths), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, DEC},
 #if CONFIG_NETWORK
 {"rtmp_buffer_size", "set buffer size in bytes", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, DEC|ENC },
 #endif
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f97e3c3..34433ed 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -132,6 +132,7 @@ typedef struct RTMPContext {
 char  auth_params[500];
 int   do_reconnect;
 int   auth_tried;
+int   strict_paths;   ///< If true, enforce strict string matching on rtmp stream and application
 } RTMPContext;

 #define PLAYER_KEY_OPEN_PART_LEN 30   ///< length of partial key used for first client digest signing
@@ -480,9 +481,16 @@ static int read_connect(URLContext *s, RTMPContext *rt)
  "app", tmpstr, sizeof(tmpstr));
 if (ret)
 av_log(s, AV_LOG_WARNING, "App field not found in connect\n");
-if (!ret && strcmp(tmpstr, rt->app))
-av_log(s, AV_LOG_WARNING, "App field don't match up: %s <-> %s\n",
-   tmpstr, rt->app);
+if (!ret && strcmp(tmpstr, rt->app)) {
+if (rt->strict_paths) {
+av_log(s, AV_LOG_ERROR, "App field don't match up: %s <-> %s. "
+   "Exiting since rtmp_strict_paths provided\n", tmpstr, rt->app);
+return AVERROR(EIO);
+} else {
+av_log(s, AV_LOG_WARNING, "App field don't match up: %s <-> %s\n",
+tmpstr, rt->app);
+}
+}
 ff_rtmp_packet_destroy(&pkt);

 // Send Window Acknowledgement Size (as defined in specification)
@@ -1947,9 +1955,16 @@ static int send_invoke_response(URLContext *s, RTMPPacket *pkt)
 pchar = s->filename;
 }
 pchar++;
-if (strcmp(pchar, filename))
-av_log(s, AV_LOG_WARNING, "Unexpected stream %s, expecting"
-   " %s\n", filename, pchar);
+if (strcmp(pchar, filename)) {
+if (rt->strict_paths) {
+av_log(s, AV_LOG_ERROR, "Unexpected stream %s, expecting %s. "
+"Exiting since rtmp_strict_paths provided.\n", filename, pchar);
+return AVERROR(EIO);
+} else {
+av_log(s, AV_LOG_WARNING, "Unexpected stream %s, expecting"
+" %s\n", filename, pchar);
+}
+}
 }
 rt->state = STATE_RECEIVING;
 }
@@ -3119,6 +3134,7 @@ static const AVOption rtmp_options[] = {
 {"listen",  "Listen for incoming rtmp connections", OFFSET(listen), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtmp_listen" },
 {"tcp_nodelay", "Use TCP_NODELAY to disable Nagle's algorithm", OFFSET(tcp_nodelay), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC|ENC},
 {"timeout", "Maximum timeout (in

Re: [FFmpeg-devel] [PATCH] avformat/hlsplaylist: set stream name according to var_stream_map varname

2024-09-27 Thread jb



Am 26.09.24 um 09:28 schrieb Jonathan Baecker:

From: jb-alvarado 

If name:* is set in var_stream_map variable, take that as NAME= variable. This 
helps gives better stream names in html players.
---
  libavformat/hlsenc.c  | 2 +-
  libavformat/hlsplaylist.c | 9 +++--
  libavformat/hlsplaylist.h | 2 +-
  3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 1e932b7..8e01721 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1533,7 +1533,7 @@ static int create_master_playlist(AVFormatContext *s,
  break;
  }

-ff_hls_write_subtitle_rendition(hls->m3u8_out, sgroup, vtt_m3u8_rel_name, 
vs->language, i, hls->has_default_key ? vs->is_default : 1);
+ff_hls_write_subtitle_rendition(hls->m3u8_out, sgroup, vtt_m3u8_rel_name, 
vs->language, vs->varname, i, hls->has_default_key ? vs->is_default : 1);
  }

  if (!hls->has_default_key || !hls->has_video_m3u8) {
diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c
index f8a6977..2eedc32 100644
--- a/libavformat/hlsplaylist.c
+++ b/libavformat/hlsplaylist.c
@@ -57,13 +57,18 @@ void ff_hls_write_audio_rendition(AVIOContext *out, const 
char *agroup,

  void ff_hls_write_subtitle_rendition(AVIOContext *out, const char *sgroup,
   const char *filename, const char 
*language,
- int name_id, int is_default)
+ const char *varname, int name_id, int 
is_default)
  {
  if (!out || !filename)
  return;

  avio_printf(out, "#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID=\"%s\"", sgroup);
-avio_printf(out, ",NAME=\"subtitle_%d\",DEFAULT=%s,", name_id, is_default ? "YES" : 
"NO");
+if (varname) {
+avio_printf(out, ",NAME=\"%s\",", varname);
+} else {
+avio_printf(out, ",NAME=\"subtitle_%d\",", name_id);
+}
+avio_printf(out, "DEFAULT=%s,", is_default ? "YES" : "NO");
  if (language) {
  avio_printf(out, "LANGUAGE=\"%s\",", language);
  }
diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h
index d7aa44d..f181182 100644
--- a/libavformat/hlsplaylist.h
+++ b/libavformat/hlsplaylist.h
@@ -41,7 +41,7 @@ void ff_hls_write_audio_rendition(AVIOContext *out, const 
char *agroup,
int name_id, int is_default, int 
nb_channels);
  void ff_hls_write_subtitle_rendition(AVIOContext *out, const char *sgroup,
   const char *filename, const char 
*language,
- int name_id, int is_default);
+ const char *varname, int name_id, int 
is_default);
  void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth,
int avg_bandwidth,
const char *filename, const char *agroup,
--
2.46.1


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avformat/hlsplaylist: set stream name according to var_stream_map varname

2024-09-27 Thread jb

Sorry for the last empty replay!

That patch is not working correctly.

The variable `varname` is also used for multiple video streams.

Is there another way, to specify the language name?

Am 26.09.24 um 09:28 schrieb Jonathan Baecker:

From: jb-alvarado 

If name:* is set in var_stream_map variable, take that as NAME= variable. This 
helps gives better stream names in html players.
---
  libavformat/hlsenc.c  | 2 +-
  libavformat/hlsplaylist.c | 9 +++--
  libavformat/hlsplaylist.h | 2 +-
  3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 1e932b7..8e01721 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1533,7 +1533,7 @@ static int create_master_playlist(AVFormatContext *s,
  break;
  }

-ff_hls_write_subtitle_rendition(hls->m3u8_out, sgroup, vtt_m3u8_rel_name, 
vs->language, i, hls->has_default_key ? vs->is_default : 1);
+ff_hls_write_subtitle_rendition(hls->m3u8_out, sgroup, vtt_m3u8_rel_name, 
vs->language, vs->varname, i, hls->has_default_key ? vs->is_default : 1);
  }

  if (!hls->has_default_key || !hls->has_video_m3u8) {
diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c
index f8a6977..2eedc32 100644
--- a/libavformat/hlsplaylist.c
+++ b/libavformat/hlsplaylist.c
@@ -57,13 +57,18 @@ void ff_hls_write_audio_rendition(AVIOContext *out, const 
char *agroup,

  void ff_hls_write_subtitle_rendition(AVIOContext *out, const char *sgroup,
   const char *filename, const char 
*language,
- int name_id, int is_default)
+ const char *varname, int name_id, int 
is_default)
  {
  if (!out || !filename)
  return;

  avio_printf(out, "#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID=\"%s\"", sgroup);
-avio_printf(out, ",NAME=\"subtitle_%d\",DEFAULT=%s,", name_id, is_default ? "YES" : 
"NO");
+if (varname) {
+avio_printf(out, ",NAME=\"%s\",", varname);
+} else {
+avio_printf(out, ",NAME=\"subtitle_%d\",", name_id);
+}
+avio_printf(out, "DEFAULT=%s,", is_default ? "YES" : "NO");
  if (language) {
  avio_printf(out, "LANGUAGE=\"%s\",", language);
  }
diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h
index d7aa44d..f181182 100644
--- a/libavformat/hlsplaylist.h
+++ b/libavformat/hlsplaylist.h
@@ -41,7 +41,7 @@ void ff_hls_write_audio_rendition(AVIOContext *out, const 
char *agroup,
int name_id, int is_default, int 
nb_channels);
  void ff_hls_write_subtitle_rendition(AVIOContext *out, const char *sgroup,
   const char *filename, const char 
*language,
- int name_id, int is_default);
+ const char *varname, int name_id, int 
is_default);
  void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth,
int avg_bandwidth,
const char *filename, const char *agroup,
--
2.46.1


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".