Re: [FFmpeg-devel] [PATCH] avformat/subfile: allow to extract till EOF
Le quintidi 25 brumaire, an CCXXVI, Gyan Doshi a écrit : > Disregard patch in first message. Didn't remove residue of aborted doc > change earlier. Patch applied. Thanks. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/subfile: allow to extract till EOF
Ping. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/subfile: allow to extract till EOF
Disregard patch in first message. Didn't remove residue of aborted doc change earlier. Regards, Gyan From 418879680f6d009b37aea29f667a5df142a83f83 Mon Sep 17 00:00:00 2001 From: Gyan DoshiDate: Wed, 15 Nov 2017 17:36:19 +0530 Subject: [PATCH] avformat/subfile: allow to extract till EOF Users can set end offset as 0 to extract till end of file. Tested locally and documented. --- doc/protocols.texi| 6 ++ libavformat/subfile.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/doc/protocols.texi b/doc/protocols.texi index a7968ff56e..f50a49b789 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -1186,6 +1186,7 @@ Accepted options: Start offset of the extracted segment, in bytes. @item end End offset of the extracted segment, in bytes. +If set to 0, extract till end of file. @end table Examples: @@ -1201,6 +1202,11 @@ Play an AVI file directly from a TAR archive: subfile,,start,183241728,end,366490624,,:archive.tar @end example +Play a MPEG-TS file from start offset till end: +@example +subfile,,start,32815239,end,0,,:video.ts +@end example + @section tee Writes the output to multiple protocols. The individual outputs are separated diff --git a/libavformat/subfile.c b/libavformat/subfile.c index 497cf85211..b527f2bee1 100644 --- a/libavformat/subfile.c +++ b/libavformat/subfile.c @@ -72,6 +72,9 @@ static int subfile_open(URLContext *h, const char *filename, int flags, SubfileContext *c = h->priv_data; int ret; +if (!c->end) +c->end = INT64_MAX; + if (c->end <= c->start) { av_log(h, AV_LOG_ERROR, "end before start\n"); return AVERROR(EINVAL); -- 2.11.1.windows.1___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/subfile: allow to extract till EOF
Attached patch allows users to set end offset as 0 to extract till end of file. Tested locally and documented. Regards, Gyan From e5c555774f88639f0e9337f1b55733d0ad156b64 Mon Sep 17 00:00:00 2001 From: Gyan DoshiDate: Wed, 15 Nov 2017 17:12:30 +0530 Subject: [PATCH] avformat/subfile: allow to extract till EOF Users can set end offset as 0 to extract till end of file. Tested locally and documented. --- doc/protocols.texi| 8 +++- libavformat/subfile.c | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/protocols.texi b/doc/protocols.texi index a7968ff56e..18c72532e1 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -1186,6 +1186,7 @@ Accepted options: Start offset of the extracted segment, in bytes. @item end End offset of the extracted segment, in bytes. +If set to 0, extract till end of file. @end table Examples: @@ -1193,7 +1194,7 @@ Examples: Extract a chapter from a DVD VOB file (start and end sectors obtained externally and multiplied by 2048): @example -subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB +ffmpeg subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB @end example Play an AVI file directly from a TAR archive: @@ -1201,6 +1202,11 @@ Play an AVI file directly from a TAR archive: subfile,,start,183241728,end,366490624,,:archive.tar @end example +Play a MPEG-TS file from start offset till end: +@example +subfile,,start,32815239,end,0,,:video.ts +@end example + @section tee Writes the output to multiple protocols. The individual outputs are separated diff --git a/libavformat/subfile.c b/libavformat/subfile.c index 497cf85211..2094cdcdd0 100644 --- a/libavformat/subfile.c +++ b/libavformat/subfile.c @@ -72,6 +72,9 @@ static int subfile_open(URLContext *h, const char *filename, int flags, SubfileContext *c = h->priv_data; int ret; +if (c->end == 0) +c->end = INT64_MAX; + if (c->end <= c->start) { av_log(h, AV_LOG_ERROR, "end before start\n"); return AVERROR(EINVAL); -- 2.11.1.windows.1___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel