diff mbox

[FFmpeg-devel] avformat/mpegtsenc: warn users if codec isn't supported

Message ID a214a875-c78a-109a-fb65-8136ae07d6c4@gyani.pro
State New
Headers show

Commit Message

Gyan Doshi Dec. 20, 2019, 11:25 a.m. UTC
Regards,
Gyan
From fbbd221b089f3b272cfd712c3d4824dd86b4eac0 Mon Sep 17 00:00:00 2001
From: Gyan Doshi <ffmpeg@gyani.pro>
Date: Fri, 20 Dec 2019 16:39:32 +0530
Subject: [PATCH] avformat/mpegtsenc: warn users if codec isn't supported

The MPEG-TS muxer will mux streams with unsupported codec id
as a private data stream; this usually makes the stream
not recognizable by ffmpeg and likely other tools.
---
 libavformat/mpegtsenc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gyan Doshi Dec. 23, 2019, 7:28 a.m. UTC | #1
On 20-12-2019 04:55 pm, Gyan wrote:
>
> Regards,
> Gyan

Will push tonight.

Gyan
Limin Wang Dec. 23, 2019, 3:15 p.m. UTC | #2
On Fri, Dec 20, 2019 at 04:55:12PM +0530, Gyan wrote:
> 
> Regards,
> Gyan

> From fbbd221b089f3b272cfd712c3d4824dd86b4eac0 Mon Sep 17 00:00:00 2001
> From: Gyan Doshi <ffmpeg@gyani.pro>
> Date: Fri, 20 Dec 2019 16:39:32 +0530
> Subject: [PATCH] avformat/mpegtsenc: warn users if codec isn't supported
> 
> The MPEG-TS muxer will mux streams with unsupported codec id
> as a private data stream; this usually makes the stream
> not recognizable by ffmpeg and likely other tools.
> ---
>  libavformat/mpegtsenc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index 5b4694bfd1..f24112465a 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -382,6 +382,7 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
>              stream_type = STREAM_TYPE_METADATA;
>              break;
>          default:
> +            av_log(s, AV_LOG_WARNING, "Stream %d, codec %s, is muxed as a private data stream and may not be recognized upon reading.\n", i, avcodec_get_name(st->codecpar->codec_id));

I suggest that you can split long code into two lines.

>              stream_type = STREAM_TYPE_PRIVATE_DATA;
>              break;
>          }
> -- 
> 2.24.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-request@ffmpeg.org with subject "unsubscribe".
Gyan Doshi Dec. 23, 2019, 3:38 p.m. UTC | #3
On 23-12-2019 08:45 pm, Limin Wang wrote:
> On Fri, Dec 20, 2019 at 04:55:12PM +0530, Gyan wrote:
>> Regards,
>> Gyan
>>  From fbbd221b089f3b272cfd712c3d4824dd86b4eac0 Mon Sep 17 00:00:00 2001
>> From: Gyan Doshi <ffmpeg@gyani.pro>
>> Date: Fri, 20 Dec 2019 16:39:32 +0530
>> Subject: [PATCH] avformat/mpegtsenc: warn users if codec isn't supported
>>
>> The MPEG-TS muxer will mux streams with unsupported codec id
>> as a private data stream; this usually makes the stream
>> not recognizable by ffmpeg and likely other tools.
>> ---
>>   libavformat/mpegtsenc.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
>> index 5b4694bfd1..f24112465a 100644
>> --- a/libavformat/mpegtsenc.c
>> +++ b/libavformat/mpegtsenc.c
>> @@ -382,6 +382,7 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
>>               stream_type = STREAM_TYPE_METADATA;
>>               break;
>>           default:
>> +            av_log(s, AV_LOG_WARNING, "Stream %d, codec %s, is muxed as a private data stream and may not be recognized upon reading.\n", i, avcodec_get_name(st->codecpar->codec_id));
> I suggest that you can split long code into two lines.

Done. And pushed as f0b3b55002b7ad024ef94f005cd718a14d85e485

Thanks,
Gyan
diff mbox

Patch

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 5b4694bfd1..f24112465a 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -382,6 +382,7 @@  static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
             stream_type = STREAM_TYPE_METADATA;
             break;
         default:
+            av_log(s, AV_LOG_WARNING, "Stream %d, codec %s, is muxed as a private data stream and may not be recognized upon reading.\n", i, avcodec_get_name(st->codecpar->codec_id));
             stream_type = STREAM_TYPE_PRIVATE_DATA;
             break;
         }