Re: [FFmpeg-devel] [PATCH] doc/filters: fix localtime drawtext example.

2014-09-10 Thread Nicolas George
Le quartidi 24 fructidor, an CCXXII, Simon Thelen a écrit :
 The colon after the localtime function call needs an additional layer of
 escaping or else everything until the next colon is treated as a
 fontfile.

The change looks ok, thanks. The commit message seems strange, though: I
would have expected that the text starting at %a would be interpreted as
options, not fontfile.

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/concatdec: fix warning: explicitly assigning a variable of type int to itself

2014-09-10 Thread Michael Niedermayer
On Wed, Sep 10, 2014 at 10:25:19AM +0200, Nicolas George wrote:
 Le quartidi 24 fructidor, an CCXXII, Michael Niedermayer a écrit :
  Signed-off-by: Michael Niedermayer michae...@gmx.at
  ---
   libavformat/concatdec.c |8 
   1 file changed, 4 insertions(+), 4 deletions(-)
 
 Ok for me.

applied

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/segment: add segment_format_options option

2014-09-10 Thread Steven Liu
What about push this option into format hls?


2014-09-07 19:23 GMT+08:00 Stefano Sabatini stefa...@gmail.com:

 On date Saturday 2014-09-06 22:00:05 +0200, Michael Niedermayer encoded:
  On Sat, Sep 06, 2014 at 03:46:03PM +0200, Stefano Sabatini wrote:
   TODO: bump micro
   ---
doc/muxers.texi   |  5 +
libavformat/segment.c | 25 +++--
2 files changed, 28 insertions(+), 2 deletions(-)
  
   diff --git a/doc/muxers.texi b/doc/muxers.texi
   index d7833a6..6f3ac1d 100644
   --- a/doc/muxers.texi
   +++ b/doc/muxers.texi
   @@ -804,6 +804,11 @@ reference stream. The default value is
 @code{auto}.
Override the inner container format, by default it is guessed by the
 filename
extension.
  
   +@item segment_format_options @var{options_list}
   +Set output format options using a :-separated list of key=value
   +parameters. Values containing @code{:} special characters must be
   +escaped.
   +
@item segment_list @var{name}
Generate also a listfile named @var{name}. If not specified no
listfile is generated.
 
  please add a example, i think users will have no clue how to use
  it otherwise
 
  patch LGTM otherwise

 Pushed, thanks.
 --
 FFmpeg = Formidable and Furious Mean Perennial Explosive Gigant
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH] doc/examples/transcoding: use av_packet_rescale_ts()

2014-09-10 Thread Stefano Sabatini
Simplify.
---
 doc/examples/transcoding.c | 36 +---
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c
index a8f4210..759c628 100644
--- a/doc/examples/transcoding.c
+++ b/doc/examples/transcoding.c
@@ -385,17 +385,9 @@ static int encode_write_frame(AVFrame *filt_frame, 
unsigned int stream_index, in
 
 /* prepare packet for muxing */
 enc_pkt.stream_index = stream_index;
-enc_pkt.dts = av_rescale_q_rnd(enc_pkt.dts,
-ofmt_ctx-streams[stream_index]-codec-time_base,
-ofmt_ctx-streams[stream_index]-time_base,
-AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
-enc_pkt.pts = av_rescale_q_rnd(enc_pkt.pts,
-ofmt_ctx-streams[stream_index]-codec-time_base,
-ofmt_ctx-streams[stream_index]-time_base,
-AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
-enc_pkt.duration = av_rescale_q(enc_pkt.duration,
-ofmt_ctx-streams[stream_index]-codec-time_base,
-ofmt_ctx-streams[stream_index]-time_base);
+av_packet_rescale_ts(enc_pkt,
+ ofmt_ctx-streams[stream_index]-codec-time_base,
+ ofmt_ctx-streams[stream_index]-time_base);
 
 av_log(NULL, AV_LOG_DEBUG, Muxing frame\n);
 /* mux encoded frame */
@@ -509,14 +501,9 @@ int main(int argc, char **argv)
 ret = AVERROR(ENOMEM);
 break;
 }
-packet.dts = av_rescale_q_rnd(packet.dts,
-ifmt_ctx-streams[stream_index]-time_base,
-ifmt_ctx-streams[stream_index]-codec-time_base,
-AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
-packet.pts = av_rescale_q_rnd(packet.pts,
-ifmt_ctx-streams[stream_index]-time_base,
-ifmt_ctx-streams[stream_index]-codec-time_base,
-AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+av_packet_rescale_ts(packet,
+ ifmt_ctx-streams[stream_index]-time_base,
+ 
ifmt_ctx-streams[stream_index]-codec-time_base);
 dec_func = (type == AVMEDIA_TYPE_VIDEO) ? avcodec_decode_video2 :
 avcodec_decode_audio4;
 ret = dec_func(ifmt_ctx-streams[stream_index]-codec, frame,
@@ -538,14 +525,9 @@ int main(int argc, char **argv)
 }
 } else {
 /* remux this frame without reencoding */
-packet.dts = av_rescale_q_rnd(packet.dts,
-ifmt_ctx-streams[stream_index]-time_base,
-ofmt_ctx-streams[stream_index]-time_base,
-AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
-packet.pts = av_rescale_q_rnd(packet.pts,
-ifmt_ctx-streams[stream_index]-time_base,
-ofmt_ctx-streams[stream_index]-time_base,
-AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+av_packet_rescale_ts(packet,
+ ifmt_ctx-streams[stream_index]-time_base,
+ ofmt_ctx-streams[stream_index]-time_base);
 
 ret = av_interleaved_write_frame(ofmt_ctx, packet);
 if (ret  0)
-- 
1.8.3.2

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


Re: [FFmpeg-devel] [PATCH] Fix vf_cropdetect returning negative rectangles

2014-09-10 Thread hjiodjf 97xgw46
It appears to work for me:

[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:1919 x2:1919 y1:1079 y2:1079
w:0 h:0 x:1920 y:1080 pts:80 t:0.08

...

[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:1524 x2:1919 y1:251 y2:1079
w:384 h:816 x:1530 y:258 pts:1160 t:1.16 crop=384:816:1530:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:1496 x2:1919 y1:251 y2:1079
w:416 h:816 x:1500 y:258 pts:1200 t:1.20 crop=416:816:1500:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:1397 x2:1919 y1:251 y2:1079
w:512 h:816 x:1404 y:258 pts:1240 t:1.24 crop=512:816:1404:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:281 x2:1919 y1:251 y2:1079
w:1632 h:816 x:286 y:258 pts:1280 t:1.28 crop=1632:816:286:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:247 x2:1919 y1:251 y2:1079
w:1664 h:816 x:252 y:258 pts:1320 t:1.32 crop=1664:816:252:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:174 x2:1919 y1:251 y2:1079
w:1744 h:816 x:176 y:258 pts:1360 t:1.36 crop=1744:816:176:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:156 x2:1919 y1:251 y2:1079
w:1760 h:816 x:158 y:258 pts:1400 t:1.40 crop=1760:816:158:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:139 x2:1919 y1:251 y2:1079
w:1776 h:816 x:142 y:258 pts:1440 t:1.44 crop=1776:816:142:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:123 x2:1919 y1:251 y2:1079
w:1792 h:816 x:126 y:258 pts:1480 t:1.48 crop=1792:816:126:258
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:106 x2:1919 y1:175 y2:1079
w:1808 h:896 x:110 y:180 pts:1520 t:1.52 crop=1808:896:110:180
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:90 x2:1919 y1:175 y2:1079
w:1824 h:896 x:94 y:180 pts:1560 t:1.56 crop=1824:896:94:180
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:74 x2:1919 y1:175 y2:1079
w:1840 h:896 x:78 y:180 pts:1600 t:1.60 crop=1840:896:78:180
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:57 x2:1919 y1:175 y2:1079
w:1856 h:896 x:62 y:180 pts:1640 t:1.64 crop=1856:896:62:180
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:41 x2:1919 y1:140 y2:1079
w:1872 h:928 x:46 y:146 pts:1680 t:1.68 crop=1872:928:46:146
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:26 x2:1919 y1:140 y2:1079
w:1888 h:928 x:30 y:146 pts:1720 t:1.72 crop=1888:928:30:146
[Parsed_cropdetect_0 @ 0x7ffbb050e420] x1:13 x2:1919 y1:140 y2:1079
w:1904 h:928 x:16 y:146 pts:1760 t:1.76 crop=1904:928:16:146

...

Stable after this point

On Tue, Sep 9, 2014 at 6:29 PM, Michael Niedermayer michae...@gmx.at wrote:
 On Tue, Sep 09, 2014 at 06:10:01PM -0700, hjiodjf 97xgw46 wrote:
 On Mon, Sep 8, 2014 at 5:21 PM, Michael Niedermayer michae...@gmx.at wrote:
  On Mon, Sep 08, 2014 at 11:16:49AM -0700, hjiodjf 97xgw46 wrote:
  On Thu, Sep 4, 2014 at 1:08 PM, Michael Niedermayer michae...@gmx.at 
  wrote:
   On Tue, Sep 02, 2014 at 02:20:40PM -0700, hjiodjf 97xgw46 wrote:
  [...]
 
  Moreover, as you said, this patch reduces the number of passes through
  a blank frame from 4 to 2, which should improve performance on movies
  with many dark scenes.
 
  yes but thats seperate from what values are output for blank frames
 
  should be fixed so it only needs 2 passes now
 
  [...]
 
  --
  Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
  When the tyrant has disposed of foreign enemies by conquest or treaty, and
  there is nothing more to fear from them, then he is always stirring up
  some war or other, in order that the people may require a leader. -- Plato
 
  ___
  ffmpeg-devel mailing list
  ffmpeg-devel@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 

 I was not aware that the cropdetect filter was designed to prevent
 shrinking the window over a given number of frames. I have attached a
 revised patch that prevents negative window sizes based on your patch.
 I still believe that negative windows should be avoided. My reasoning
 for this was provided in my previous email.

  vf_cropdetect.c |8 
  1 file changed, 4 insertions(+), 4 deletions(-)
 9b9f96427726e38cd3ae5d1f2fc7d77307bbc366  
 0001-Avoid-returning-negative-rectangles-from-cropdetect.patch
 From e86c0bd1b2f855c53c78be0a7269e1132bc1daf6 Mon Sep 17 00:00:00 2001
 From: tue46wsdgxfjrt jfb...@gmail.com
 Date: Tue, 9 Sep 2014 18:05:44 -0700
 Subject: [PATCH] Avoid returning negative rectangles from cropdetect

 ---
  libavfilter/vf_cropdetect.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

 diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
 index 76aa7b2..4b6ee91 100644
 --- a/libavfilter/vf_cropdetect.c
 +++ b/libavfilter/vf_cropdetect.c
 @@ -106,8 +106,8 @@ static int config_input(AVFilterLink *inlink)

  s-x1 = inlink-w - 1;
  s-y1 = inlink-h - 1;
 -s-x2 = 0;
 -s-y2 = 0;
 +s-x2 = s-x1;
 +s-y2 = s-y1;

  return 0;
  }
 @@ -131,8 +131,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
 *frame)
  if (s-reset_count  0  s-frame_nb  s-reset_count) {
  s-x1 = frame-width  - 1;
  s-y1 = frame-height - 

Re: [FFmpeg-devel] [PATCH] doc/filters: fix localtime drawtext example.

2014-09-10 Thread Simon Thelen
On 10/09/14 at 10:24, Nicolas George wrote:
 Le quartidi 24 fructidor, an CCXXII, Simon Thelen a écrit :
  The colon after the localtime function call needs an additional layer of
  escaping or else everything until the next colon is treated as a
  fontfile.
 
 The change looks ok, thanks. The commit message seems strange, though: I
 would have expected that the text starting at %a would be interpreted as
 options, not fontfile.
I'm not sure why it's being detected as a fontfile instead of as an
option either, but here are the error messages if you're interested:
[..]
[Parsed_drawtext_0 @ 0x2c02800] Could not load font %a %b %d %Y}: cannot open 
resource
[Parsed_drawtext_0 @ 0x2c02800] Using /usr/share/fonts/dejavu/DejaVuSans.ttf
[..]
[Parsed_drawtext_0 @ 0x2c02800] Unterminated %{} near '{localtime'}'
[..]

And that was with this command line:
ffmpeg -i input.mp4 -vf 
drawtext='fontfile=/usr/share/fonts/dejavu/DejaVuSans.ttf:text=%{localtime:%a 
%b %d %Y}' out.mkv

-- 
Simon Thelen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Fix vf_cropdetect returning negative rectangles

2014-09-10 Thread Michael Niedermayer
On Wed, Sep 10, 2014 at 10:35:23AM -0700, hjiodjf 97xgw46 wrote:
 It appears to work for me:


./ffmpeg -i matrixbench_mpeg2.mpg -vframes 5 -an -vf cropdetect -f null -

before patch:
[Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:201 y2:437 w:624 h:224 x:94 
y:208 pts:7200 t:0.08 crop=624:224:94:208
[Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 
y:198 pts:10800 t:0.12 crop=624:240:94:198
[Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 
y:198 pts:14400 t:0.16 crop=624:240:94:198
[Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 
y:198 pts:18000 t:0.20 crop=624:240:94:198

after patch:
[Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:201 y2:575 w:624 h:368 x:94 
y:206 pts:7200 t:0.08 crop=624:368:94:206
[Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 
y:204 pts:10800 t:0.12 crop=624:368:94:204
[Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 
y:204 pts:14400 t:0.16 crop=624:368:94:204
[Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 
y:204 pts:18000 t:0.20 crop=624:368:94:204



[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Fix vf_cropdetect returning negative rectangles

2014-09-10 Thread hjiodjf 97xgw46
On Wed, Sep 10, 2014 at 11:26 AM, Michael Niedermayer michae...@gmx.at wrote:
 On Wed, Sep 10, 2014 at 10:35:23AM -0700, hjiodjf 97xgw46 wrote:
 It appears to work for me:


 ./ffmpeg -i matrixbench_mpeg2.mpg -vframes 5 -an -vf cropdetect -f null -

 before patch:
 [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:201 y2:437 w:624 h:224 x:94 
 y:208 pts:7200 t:0.08 crop=624:224:94:208
 [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 
 y:198 pts:10800 t:0.12 crop=624:240:94:198
 [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 
 y:198 pts:14400 t:0.16 crop=624:240:94:198
 [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 
 y:198 pts:18000 t:0.20 crop=624:240:94:198

 after patch:
 [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:201 y2:575 w:624 h:368 x:94 
 y:206 pts:7200 t:0.08 crop=624:368:94:206
 [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 
 y:204 pts:10800 t:0.12 crop=624:368:94:204
 [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 
 y:204 pts:14400 t:0.16 crop=624:368:94:204
 [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 
 y:204 pts:18000 t:0.20 crop=624:368:94:204



 [...]
 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

 Good people do not need laws to tell them to act responsibly, while bad
 people will find a way around the laws. -- Plato

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


Sorry about that. That was a brainfart on my end. I will leave the
s-[x1,x2,y1,y2] parameters as they are and just change the reporting
of w/h/x/y. Amended patch attached.


0001-Avoid-returning-negative-rectangles-from-cropdetect.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] web: In README, CSS generated for ffmpeg repo not merged anymore due to copyright requirements

2014-09-10 Thread Lou Logan
On Sat,  6 Sep 2014 14:37:12 +0200, db0company wrote:

 ---
  README |5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)

Pushed, thanks!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/3] web: In the nav, Developers links to developer.html + new Contribute link

2014-09-10 Thread Lou Logan
On Sat, 06 Sep 2014 09:15:40 -0800, Lou wrote:

 On Sat, Sep 6, 2014, at 04:37 AM, db0company wrote:
  ---
   src/template_head2 |3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)
 
 LGTM, thanks.
 
 I can apply, but I'll be unable to until Monday. Anyone else can feel
 free to beat me to it.

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


Re: [FFmpeg-devel] [PATCH 3/3] web/documentation: Simplify Components Documentation links

2014-09-10 Thread Lou Logan
On Sat,  6 Sep 2014 14:37:14 +0200, db0company wrote:

 ---
  src/documentation |   18 +-
  1 files changed, 9 insertions(+), 9 deletions(-)

Pushed, thanks!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Fix vf_cropdetect returning negative rectangles

2014-09-10 Thread Michael Niedermayer
On Wed, Sep 10, 2014 at 11:45:48AM -0700, hjiodjf 97xgw46 wrote:
 On Wed, Sep 10, 2014 at 11:26 AM, Michael Niedermayer michae...@gmx.at 
 wrote:
  On Wed, Sep 10, 2014 at 10:35:23AM -0700, hjiodjf 97xgw46 wrote:
  It appears to work for me:
 
 
  ./ffmpeg -i matrixbench_mpeg2.mpg -vframes 5 -an -vf cropdetect -f null -
 
  before patch:
  [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:201 y2:437 w:624 h:224 
  x:94 y:208 pts:7200 t:0.08 crop=624:224:94:208
  [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 
  x:94 y:198 pts:10800 t:0.12 crop=624:240:94:198
  [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 
  x:94 y:198 pts:14400 t:0.16 crop=624:240:94:198
  [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 
  x:94 y:198 pts:18000 t:0.20 crop=624:240:94:198
 
  after patch:
  [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:201 y2:575 w:624 h:368 
  x:94 y:206 pts:7200 t:0.08 crop=624:368:94:206
  [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 
  x:94 y:204 pts:10800 t:0.12 crop=624:368:94:204
  [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 
  x:94 y:204 pts:14400 t:0.16 crop=624:368:94:204
  [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 
  x:94 y:204 pts:18000 t:0.20 crop=624:368:94:204
 
 
 
  [...]
  --
  Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
  Good people do not need laws to tell them to act responsibly, while bad
  people will find a way around the laws. -- Plato
 
  ___
  ffmpeg-devel mailing list
  ffmpeg-devel@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 
 
 Sorry about that. That was a brainfart on my end. I will leave the
 s-[x1,x2,y1,y2] parameters as they are and just change the reporting
 of w/h/x/y. Amended patch attached.

  vf_cropdetect.c |8 +---
  1 file changed, 5 insertions(+), 3 deletions(-)
 014f97e9d8a29154e5f7fba9e54e550692f4416d  
 0001-Avoid-returning-negative-rectangles-from-cropdetect.patch
 From 5281e57c62a13973c778c9296c98632de8bd5864 Mon Sep 17 00:00:00 2001
 From: tue46wsdgxfjrt jfb...@gmail.com
 Date: Tue, 9 Sep 2014 18:05:44 -0700
 Subject: [PATCH] Avoid returning negative rectangles from cropdetect
 
 ---
  libavfilter/vf_cropdetect.c | 8 +---
  1 file changed, 5 insertions(+), 3 deletions(-)
 
 diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
 index 76aa7b2..70d7d66 100644
 --- a/libavfilter/vf_cropdetect.c
 +++ b/libavfilter/vf_cropdetect.c
 @@ -120,7 +120,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
 *frame)
  AVFilterContext *ctx = inlink-dst;
  CropDetectContext *s = ctx-priv;
  int bpp = s-max_pixsteps[0];
 -int w, h, x, y, shrink_by;
 +int w, h, x, y, x2, y2, shrink_by;
  AVDictionary **metadata;
  
  // ignore first 2 frames - they may be empty
 @@ -168,9 +168,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
 *frame)
  // make sure they stay rounded!
  x = (s-x1+1)  ~1;
  y = (s-y1+1)  ~1;
 +x2 = FFMAX(x, (s-x2+1)  ~1);
 +y2 = FFMAX(y, (s-y2+1)  ~1);
  
 -w = s-x2 - x + 1;
 -h = s-y2 - y + 1;
 +w = x2 - x + 1;
 +h = y2 - y + 1;

this can result in a width and height larger than the input


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Do not ask for mxf samples with unknown field dominance

2014-09-10 Thread Tomas Härdin
On Tue, 2014-08-19 at 22:30 +0200, Michael Niedermayer wrote:
 On Tue, Aug 19, 2014 at 01:30:24AM +0200, Carl Eugen Hoyos wrote:
  Hi!
  
  Attached patch removes a request for samples of which we already
  have several that all work fine.
 
 field_dominance can have 256 different values, do we have samples
 for all ? do they even exist ?

As far as I recall there are only two (1, 2) and possibly unknown (0).

/Tomas


signature.asc
Description: This is a digitally signed message part
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] MXF : default fied dominance is TFF

2014-09-10 Thread Tomas Härdin
On Tue, 2014-09-09 at 12:37 +0200, Michael Niedermayer wrote:
 On Mon, Sep 08, 2014 at 12:17:14PM +, Gaullier Nicolas wrote:
  I did not found an easy way to set up initialization values to properly 
  handle defaults but I am not a highly skilled developer, and maybe someone 
  will find how to implement this more elegantly.
  They are also many other properties in mxf that are only optional, for 
  example component depth and horizontal/vertical subsampling factors that 
  are actually parsed, but as far from now it does not seem sufficiently 
  useful to distinguish between the initialization value '0' and 'not 
  present'.
  In my opinion, in the solely case of the field dominance, when it is 
  found/set to '0', it seems interesting to fail/raise a warning at least, 
  but it is somewhat particular and should not involve a big code refactoring 
  to handle this.
 
 field_dominance could be initilaized to -1 (or some named identifer
 that is -1)
 and a case -1 be added to the switch()

Initializing to the default value (1 = MXF_TFF) makes more sense. For
any illegal value the demuxer should probably complain so the user can
complain at whoever wrote the bad muxer they're using.

/Tomas


signature.asc
Description: This is a digitally signed message part
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avutil/avstring: support asymmetric escaping in av_get_token()

2014-09-10 Thread Michael Niedermayer
This avoids having to construct filter command lines by trial and error
or specialized tools.

Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 doc/filters.texi |2 +-
 libavutil/avstring.c |   18 +-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index bb486ea..d30e985 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4196,7 +4196,7 @@ DS=1.0 # display start
 DE=10.0 # display end
 FID=1.5 # fade in duration
 FOD=5 # fade out duration
-ffplay -f lavfi 
color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff%@{eif:
 clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - 
$DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE 
- $FOD\\, $DE) )\\, 0\\, 255) : x: 2 @}
+ffplay -f lavfi 
color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff%@{eif:
 clip(255*(1*between(t, $DS + $FID, $DE - $FOD) + ((t - $DS)/$FID)*between(t, 
$DS, $DS + $FID) + (-(t - $DE)/$FOD)*between(t, $DE - $FOD, $DE) ), 0, 255) : 
x: 2 @}
 @end example
 
 @end itemize
diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index fd010e4..ff7a98e 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -151,11 +151,13 @@ char *av_get_token(const char **buf, const char *term)
 char *out = av_malloc(strlen(*buf) + 1);
 char *ret = out, *end = out;
 const char *p = *buf;
+char stack[256];
+int stack_index = 0;
 if (!out)
 return NULL;
 p += strspn(p, WHITESPACES);
 
-while (*p  !strspn(p, term)) {
+while (*p  (stack_index || !strspn(p, term))) {
 char c = *p++;
 if (c == '\\'  *p) {
 *out++ = *p++;
@@ -168,6 +170,20 @@ char *av_get_token(const char **buf, const char *term)
 end = out;
 }
 } else {
+if (stack_index  FF_ARRAY_ELEMS(stack)) {
+if (c == '(') {
+stack[stack_index++] = ')';
+} else if (c == '{') {
+stack[stack_index++] = '}';
+} else if (stack_index  stack[stack_index - 1] == c) {
+stack_index--;
+} else if (c == ')' || c == '}') {
+av_log(NULL, AV_LOG_WARNING, Mismatching brackets, 
expected %c but got %c in \'%s\'\n,
+   stack_index ? stack[stack_index - 1] : ' ', c, 
*buf);
+}
+} else
+av_log(NULL, AV_LOG_WARNING, Brackets nested too deeply in 
\'%s\'\n,
+   *buf);
 *out++ = c;
 }
 }
-- 
1.7.9.5

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


Re: [FFmpeg-devel] MXF : default fied dominance is TFF

2014-09-10 Thread Michael Niedermayer
On Wed, Sep 10, 2014 at 10:47:12PM +0200, Tomas Härdin wrote:
 On Tue, 2014-09-09 at 12:37 +0200, Michael Niedermayer wrote:
  On Mon, Sep 08, 2014 at 12:17:14PM +, Gaullier Nicolas wrote:
   I did not found an easy way to set up initialization values to properly 
   handle defaults but I am not a highly skilled developer, and maybe 
   someone will find how to implement this more elegantly.
   They are also many other properties in mxf that are only optional, for 
   example component depth and horizontal/vertical subsampling factors that 
   are actually parsed, but as far from now it does not seem sufficiently 
   useful to distinguish between the initialization value '0' and 'not 
   present'.
   In my opinion, in the solely case of the field dominance, when it is 
   found/set to '0', it seems interesting to fail/raise a warning at least, 
   but it is somewhat particular and should not involve a big code 
   refactoring to handle this.
  
  field_dominance could be initilaized to -1 (or some named identifer
  that is -1)
  and a case -1 be added to the switch()
 
 Initializing to the default value (1 = MXF_TFF) makes more sense.

 For
 any illegal value the demuxer should probably complain so the user can
 complain at whoever wrote the bad muxer they're using.

yes


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] suggested patch: avfilter/vf_subtitles: add support for subtitles font scaling

2014-09-10 Thread Sergey
Hello.

Recently I used ffmpeg to embed subtitles, and I needed to scale them.

I thought original_size option scales subtitles, but it does not.
So I wrote a short patch for it to do that (attached)

If that is considered too complex/bad idea I've also attached another patch
that adds a font_scale option instead.

I hope you like one of these.
-- diff -ur ffmpeg-HEAD-649b7a9/libavfilter/vf_subtitles.c ffmpeg-HEAD-649b7a9.new/libavfilter/vf_subtitles.c
--- ffmpeg-HEAD-649b7a9/libavfilter/vf_subtitles.c	2014-09-10 00:07:59.0 +
+++ ffmpeg-HEAD-649b7a9.new/libavfilter/vf_subtitles.c	2014-09-10 00:11:26.0 +
@@ -136,9 +136,11 @@
 ff_draw_init(ass-draw, inlink-format, 0);
 
 ass_set_frame_size  (ass-renderer, inlink-w, inlink-h);
-if (ass-original_w  ass-original_h)
+if (ass-original_w  ass-original_h) {
 ass_set_aspect_ratio(ass-renderer, (double)inlink-w / inlink-h,
  (double)ass-original_w / ass-original_h);
+ass_set_font_scale(ass-renderer, (inlink-w + inlink-h) * 1.0 / (ass-original_w + ass-original_h));
+}
 
 return 0;
 }
diff -ur ffmpeg-HEAD-649b7a9/libavfilter/vf_subtitles.c ffmpeg-HEAD-649b7a9.new/libavfilter/vf_subtitles.c
--- ffmpeg-HEAD-649b7a9/libavfilter/vf_subtitles.c	2014-09-10 01:02:49.0 +
+++ ffmpeg-HEAD-649b7a9.new/libavfilter/vf_subtitles.c	2014-09-10 03:34:19.0 +
@@ -55,6 +55,7 @@
 uint8_t rgba_map[4];
 int pix_step[4];   /// steps per pixel for each plane of the main output
 int original_w, original_h;
+double font_scale;
 FFDrawContext draw;
 } AssContext;
 
@@ -65,6 +66,7 @@
 {filename,   set the filename of file to read, OFFSET(filename),   AV_OPT_TYPE_STRING, {.str = NULL},  CHAR_MIN, CHAR_MAX, FLAGS }, \
 {f,  set the filename of file to read, OFFSET(filename),   AV_OPT_TYPE_STRING, {.str = NULL},  CHAR_MIN, CHAR_MAX, FLAGS }, \
 {original_size,  set the size of the original video (used to scale fonts), OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL},  CHAR_MIN, CHAR_MAX, FLAGS }, \
+{font_scale, set font scale,   OFFSET(font_scale), AV_OPT_TYPE_DOUBLE, {.dbl = 1}, 0.01, 99,   FLAGS }, \
 
 /* libass supports a log level ranging from 0 to 7 */
 static const int ass_libavfilter_log_level_map[] = {
@@ -139,6 +141,7 @@
 if (ass-original_w  ass-original_h)
 ass_set_aspect_ratio(ass-renderer, (double)inlink-w / inlink-h,
  (double)ass-original_w / ass-original_h);
+ass_set_font_scale(ass-renderer, ass-font_scale);
 
 return 0;
 }
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel