Hi, the attached patch fixes an overflow issue I was getting for (overconservatively) large buffer sizes and large picture heights, i.e. buf_size=2.5 MB and end_y=1024. I'm aware this buf_size is _much_ too large (being lazy, I allocate enough buffer for a complete uncompressed image so I _know_ it will be enough)... OTOH, ffmpeg's (static) buffer size (256 KB) is already within an order of magnitude of the "critical" size. Comments, please... Martin -- Martin B?hme Inst. f. Neuro- and Bioinformatics Ratzeburger Allee 160, D-23538 Luebeck Phone: +49 451 500 5514 Fax: +49 451 500 5502 boehme at inb.uni-luebeck.de
Hi On Monday 25 July 2005 17:23, Martin Boehme wrote:
Hi,
the attached patch fixes an overflow issue I was getting for (overconservatively) large buffer sizes and large picture heights, i.e. buf_size=2.5 MB and end_y=1024. I'm aware this buf_size is _much_ too large (being lazy, I allocate enough buffer for a complete uncompressed image so I _know_ it will be enough)... OTOH, ffmpeg's (static) buffer size (256 KB) is already within an order of magnitude of the "critical" size.
Comments, please...
applied btw i dont think buf_size=width*height*1.5 is enough, try random 255/0 sample values at qp=1, btw2 if you actually try this i would be interrested in the results [...] -- Michael
Michael Niedermayer wrote:
On Monday 25 July 2005 17:23, Martin Boehme wrote:
the attached patch fixes an overflow issue I was getting for (overconservatively) large buffer sizes and large picture heights, i.e. buf_size=2.5 MB and end_y=1024. I'm aware this buf_size is _much_ too large (being lazy, I allocate enough buffer for a complete uncompressed image so I _know_ it will be enough)... OTOH, ffmpeg's (static) buffer size (256 KB) is already within an order of magnitude of the "critical" size.
applied btw i dont think buf_size=width*height*1.5 is enough, try random 255/0 sample values at qp=1, btw2 if you actually try this i would be interrested in the results
Tried it, with MPEG-4 I get about width*height*3.63 bytes per frame... ouch. So I now use width*height*4... ;-) under the assumption that the above is just about the worst case... (BTW, is that true?) Martin -- Martin B?hme Inst. f. Neuro- and Bioinformatics Ratzeburger Allee 160, D-23538 Luebeck Phone: +49 451 500 5514 Fax: +49 451 500 5502 boehme at inb.uni-luebeck.de
Hi On Tuesday 26 July 2005 13:19, Martin Boehme wrote:
Michael Niedermayer wrote:
On Monday 25 July 2005 17:23, Martin Boehme wrote:
the attached patch fixes an overflow issue I was getting for (overconservatively) large buffer sizes and large picture heights, i.e. buf_size=2.5 MB and end_y=1024. I'm aware this buf_size is _much_ too large (being lazy, I allocate enough buffer for a complete uncompressed image so I _know_ it will be enough)... OTOH, ffmpeg's (static) buffer size (256 KB) is already within an order of magnitude of the "critical" size.
applied btw i dont think buf_size=width*height*1.5 is enough, try random 255/0 sample values at qp=1, btw2 if you actually try this i would be interrested in the results
Tried it, with MPEG-4 I get about width*height*3.63 bytes per frame... ouch. So I now use width*height*4... ;-) under the assumption that the above is just about the worst case... (BTW, is that true?)
probably not [...] -- Michael
Michael Niedermayer wrote:
On Tuesday 26 July 2005 13:19, Martin Boehme wrote:
Michael Niedermayer wrote:
btw i dont think buf_size=width*height*1.5 is enough, try random 255/0 sample values at qp=1, btw2 if you actually try this i would be interrested in the results
Tried it, with MPEG-4 I get about width*height*3.63 bytes per frame... ouch. So I now use width*height*4... ;-) under the assumption that the above is just about the worst case... (BTW, is that true?)
probably not
Hm, my feeling, too... any chance of computing an upper limit on the amount of data the encoder can spit out? (I'm not necessarily advocating doing this... just interested...) Martin -- Martin B?hme Inst. f. Neuro- and Bioinformatics Ratzeburger Allee 160, D-23538 Luebeck Phone: +49 451 500 5514 Fax: +49 451 500 5502 boehme at inb.uni-luebeck.de
Hi On Tuesday 26 July 2005 16:15, Martin Boehme wrote:
Michael Niedermayer wrote:
On Tuesday 26 July 2005 13:19, Martin Boehme wrote:
Michael Niedermayer wrote:
btw i dont think buf_size=width*height*1.5 is enough, try random 255/0 sample values at qp=1, btw2 if you actually try this i would be interrested in the results
Tried it, with MPEG-4 I get about width*height*3.63 bytes per frame... ouch. So I now use width*height*4... ;-) under the assumption that the above is just about the worst case... (BTW, is that true?)
probably not
Hm, my feeling, too... any chance of computing an upper limit on the amount of data the encoder can spit out? (I'm not necessarily advocating doing this... just interested...)
1 bit modb 1 bit modb2 2bit mb_type 6bit cbp 2bit dquant 1bit interlaced dct 1bit mv type 4bit field select 2*2*2*20bit motion vectors 6*64*30bit dct coefficoents (YV12! otherwise its more) 47bit video packet header -> 11745 bits per MB -> ~width*height*5.735 but note, if width and height are small then the size of the various headers must be considered too ... [...] -- Michael
Michael Niedermayer wrote:
On Tuesday 26 July 2005 16:15, Martin Boehme wrote:
Hm, my feeling, too... any chance of computing an upper limit on the amount of data the encoder can spit out? (I'm not necessarily advocating doing this... just interested...)
1 bit modb 1 bit modb2 2bit mb_type 6bit cbp 2bit dquant 1bit interlaced dct 1bit mv type 4bit field select 2*2*2*20bit motion vectors 6*64*30bit dct coefficoents (YV12! otherwise its more) 47bit video packet header
-> 11745 bits per MB -> ~width*height*5.735
but note, if width and height are small then the size of the various headers must be considered too ...
[...]
Interesting... thanks! Looks as if Loren got pretty close to that limit, then... Martin -- Martin B?hme Inst. f. Neuro- and Bioinformatics Ratzeburger Allee 160, D-23538 Luebeck Phone: +49 451 500 5514 Fax: +49 451 500 5502 boehme at inb.uni-luebeck.de
On Tue, 26 Jul 2005, Martin Boehme wrote:
Michael Niedermayer wrote:
On Monday 25 July 2005 17:23, Martin Boehme wrote:
the attached patch fixes an overflow issue I was getting for (overconservatively) large buffer sizes and large picture heights, i.e. buf_size=2.5 MB and end_y=1024. I'm aware this buf_size is _much_ too large (being lazy, I allocate enough buffer for a complete uncompressed image so I _know_ it will be enough)... OTOH, ffmpeg's (static) buffer size (256 KB) is already within an order of magnitude of the "critical" size.
applied btw i dont think buf_size=width*height*1.5 is enough, try random 255/0 sample values at qp=1, btw2 if you actually try this i would be interrested in the results
Tried it, with MPEG-4 I get about width*height*3.63 bytes per frame... ouch. So I now use width*height*4... ;-) under the assumption that the above is just about the worst case... (BTW, is that true?)
I can get width*height*5.292 using -lavcopts keyint=1:vqscale=1:intra_matrix=1,1,1,... (which spews "warning, clipping 1 dct coefficients to -2048..2047") Or width*height*5.657 by modifying the code to force all dct coefficients to +/- 2047 and force all blocks to be inter4v. --Loren Merritt
Hi, Im trying to stream a ts file (with only a MPEG2 video elementary stream) over UDP using a command line as: ffmpeg -i file.ts -vcodec copy -f udp udp://234.5.5.5:1234 The resulting message says: "Unknow input or output format: udp" If I use rtp instead of udp: ffmpeg -i file.ts -vcodec copy -f rtp rtp://234.5.5.5:1234 The file is served to the multicast address but not in ts format (I've use ethereal to analize it). So, Is it possible to stream using directly udp? and is it possible streaming a ts file? Thanks in advance Fernando Pescador
Hello, On Tue, 2005-07-26 at 18:19 +0200, Fernando Pescador wrote:
Hi, Im trying to stream a ts file (with only a MPEG2 video elementary stream) over UDP using a command line as: ffmpeg -i file.ts -vcodec copy -f udp udp://234.5.5.5:1234
The resulting message says: "Unknow input or output format: udp" I do not think there is any "udp" output format... Try "-f mpegts"; maybe this is what you want. But I did never try... I see that "TS over RTP" in libavformat is implemented using a TS pseudo-codec (CODEC_ID_MPEG2TS) , and I do not know how to use it.
If I use rtp instead of udp: ffmpeg -i file.ts -vcodec copy -f rtp rtp://234.5.5.5:1234
The file is served to the multicast address but not in ts format (I've use ethereal to analize it). In fact, you are asking ffmpeg to stream over rtp the video ES contained in your .ts file (so, you are probably streaming mpeg2 video over RTP).
Luca -- _____________________________________________________________________________ Copy this in your signature, if you think it is important: N O W A R ! ! !
participants (5)
-
boehme@inb.uni-luebeck.de -
lorenm@u.washington.edu -
lucabe72@email.it -
michaelni@gmx.at -
pescador@sec.upm.es