[Mjpeg-users] not all JPEG-files are accepted?

2007-03-12 Thread christian . wirtz
Hello, 

I have a script to convert JPEG-files from a digital-photo-camera to 
MVI-files(mpeg2) to wiew them on my settopbox(Dreambox500) using: 

jpeg2yuv -v0 -f25 -n1 -Ip -j.jpg | 
yuvscaler -v0 -OSIZE_720x576 2> /dev/null | 
mpeg2enc -v0 -a2 -np --cbr -b1 -D8 -f3 -o .mvi 

from mjpeg-tools 

It works fine only for about one out of 5 pictures I got an errormessage like: 
jpegdata ended unexpectedly and the mpeg2-File contains only the upper portiohn 
of the picture the rest is gray, all the JPEGSs can be shown with several 
different viewers under Windows and Linux without any problems. 
Why mjpegtools does not process these JPEGs properly? Or if they really are 
corrupt, why can the viewers show them correctly? Is there any tool to fir such 
JPEG-files that they will be accepted by mjpegtools? 

beye 

chriwi

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] not all JPEG-files are accepted?

2007-03-12 Thread gert . vervoort
Op Ma, 12 maart, 2007 10:16 am schreef [EMAIL PROTECTED]:

> jpeg2yuv -v0 -f25 -n1 -Ip -j.jpg | yuvscaler -v0 -OSIZE_720x576 2>
> /dev/null |
> mpeg2enc -v0 -a2 -np --cbr -b1 -D8 -f3 -o .mvi
>
> from mjpeg-tools
>
> It works fine only for about one out of 5 pictures I got an errormessage
> like: jpegdata ended unexpectedly and the mpeg2-File contains only the
> upper portiohn of the picture the rest is gray, all the JPEGSs can be
> shown with several different viewers under Windows and Linux without any
> problems. Why mjpegtools does not process these JPEGs properly? Or if they
> really are corrupt, why can the viewers show them correctly? Is there any
> tool to fir such JPEG-files that they will be accepted by mjpegtools?
>
>

Is the file size of those pictures bigger then 1310720 bytes?
The size of the picture you can use for jpeg2yuv is max 1310720 bytes:
http://www.mail-archive.com/mjpeg-users@lists.sourceforge.net/msg06780.html

   Gert



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] not all JPEG-files are accepted?

2007-03-12 Thread christian . wirtz
Hello Gert,

thank You for the fast answer, that might really be my problem, most of  my 
fotos come from a 3.4megapixel-camera which produces JPEGS arround 1MB 
depending on the contets of the picture probably the pictures which drop out 
are just too big.
Does mjpegtools contain a tool to resize JPEGs to a smaller number of pixels 
before they are handed to jpeg2yuv, or wich other linux-commandline-tool is 
capable of doing this job in a batchconversion ?

beye 

chriwi 



>Op Ma, 12 maart, 2007 10:16 am schreef [EMAIL PROTECTED]:
>
>> jpeg2yuv -v0 -f25 -n1 -Ip -j.jpg | yuvscaler -v0 -OSIZE_720x576 2>
>> /dev/null |
>> mpeg2enc -v0 -a2 -np --cbr -b1 -D8 -f3 -o .mvi
>>
>> from mjpeg-tools
>>
>> It works fine only for about one out of 5 pictures I got an errormessage
>> like: jpegdata ended unexpectedly and the mpeg2-File contains only the
>> upper portiohn of the picture the rest is gray, all the JPEGSs can be
>> shown with several different viewers under Windows and Linux without any
>> problems. Why mjpegtools does not process these JPEGs properly? Or if they
>> really are corrupt, why can the viewers show them correctly? Is there any
>> tool to fir such JPEG-files that they will be accepted by mjpegtools?
>>
>>
>
>Is the file size of those pictures bigger then 1310720 bytes?
>The size of the picture you can use for jpeg2yuv is max 1310720 bytes:
>http://www.mail-archive.com/mjpeg-users@lists.sourceforge.net/msg06780.html
>
>   Gert
>
>
>
>-
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys-and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>___
>Mjpeg-users mailing list
>Mjpeg-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/mjpeg-users

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


[Mjpeg-users] aspect-ratio

2007-03-12 Thread christian . wirtz
Hello,

I use mjpegtools to convert JPEGS from a digital-photo-camera to MPEG2s to view 
them on my settopbox(Dreambox500).

Iuse:
jpeg2yuv  -v0 -f25 -n1 -Ip -j.jpg   |
yuvscaler -v0 -OSIZE_720x576 2> /dev/null |
mpeg2enc  -v0 -a2 -np --cbr -b1 -D8 -f3 -o .mvi

now I would like to maintain teh aspectratio of the fotos and rather fill the 
rest of the space with black bars, is there any possibility to do this with 
mjpegtools?

beye

chriwi

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] zoran bug on DC10+

2007-03-12 Thread Ronald S. Bultje
Hi Sebastian,

On Mar 9, 2007, at 8:43 AM, Sebastian Hartman wrote:
> I'm getting "no queues buffered" constantly when
> trying to select() from the file descriptor with the
> zoran drivers in Linux 2.6.18.

So let's start with the obvious: did you queue a buffer? Please offer  
some source code.

(It's perfectly possible that select() isn't fully compliant, there  
was no app using this when I wrote the code, so I had to write my own  
testing code, which may not be what other apps do. It worked for my  
test code.)

> I looked into the
> source code and found that fh->v4l_buffers doesn't
> match fh->zr->v4l_buffers when the zoran_poll() call
> is being made. Another thing is that zoran_irq()
> increases the pend_tail index, so when zoran_poll()
> checks whether fh->v4l_buffers[pend_tail &
> ...].state == BUZ_STATE_DONE it's false (but when
> checking against fh->zr->v4l_bu and subtracting
> the index with one it's true.
>
> Is this a known bug? Additionally I saw you're
> referencing structures to each other (I assume that
> fh->zr->v4l_buffers should be exactly the same as
> fh->v4l_buffers). Example:
>
> struct monkey { char area[256]; };
> struct monkey baboon;
> struct monkey chimpansee = baboon;
> strcpy(baboon.area, "Rainforest");
>
> Now, baboon.area != chimpansee.area.
>
> You should use a pointer for this occation.

Yes, but no. V4l2 requires us to have a per-filehandle buffer  
management, so it needs to be in the fh-> struct.  The IRQ handler  
has no access to this, so we need a pointer/copy in zr->. The danger  
here is that an IRQ handler cannot keep mutexes, which means that I  
may be unsetting it in another thread at the very time when I try to  
write to it in my IRQ handler -> system down. The most practical  
solution to this is to keep a copy and have sync threads copy it when  
it matches, which is what zoran_driver.c does in line 942 of v4l_sync 
(). That is all 100% intentional, and I hope this makes it clear why  
we don't use a pointer. you will notice that prior to line 942,  
v4l_sync() only looks at zr-> before making sure that it is our  
capture session and not that of another file handle. So capturing  
obviously works as expected.

Now, let's look at select(), or rather zoran_poll(). The raw capture  
mode case first checks that our file handle queued buffers and if so,  
it looks at the zr-> structures. This all looks fine to me, so it  
looks like a bug in your code if you trigger that. What makes me  
wonder is line 4319-20, where we re-reference fh->v4l_buffers without  
copying it like in 942 of v4l_sync(), which looks kind of odd to me.  
It looks like we _should_ copy it and then check state and return the  
proper return value. You may want to check that and I'd take such a  
patch. However, first and foremost, it looks like you're not actually  
queueing buffers properly, as Laurent suggested. (The same is true  
for JPG capture as well, so he same patch there makes sense also.)

Ronald


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] not all JPEG-files are accepted?

2007-03-12 Thread Gert Vervoort
Hi Cristian,

djpeg and ppmtoy4m can be used as an alternative for jpeg2yuv:

djpeg 20070225_2710.JPG  | ppmtoy4m -r -n 200 -F 25:1 | y4mscaler -I 
sar=1:1 -O preset=DVD -O infer=PRESERVE_X -O infer=EXACT  | mpeg2enc -f 
8 -o photo2.m2v
 
   Gert

[EMAIL PROTECTED] wrote:
> Hello Gert,
>
> thank You for the fast answer, that might really be my problem, most of  my 
> fotos come from a 3.4megapixel-camera which produces JPEGS arround 1MB 
> depending on the contets of the picture probably the pictures which drop out 
> are just too big.
> Does mjpegtools contain a tool to resize JPEGs to a smaller number of pixels 
> before they are handed to jpeg2yuv, or wich other linux-commandline-tool is 
> capable of doing this job in a batchconversion ?
>
> beye 
>
> chriwi 
>
>
>
>   
>> Op Ma, 12 maart, 2007 10:16 am schreef [EMAIL PROTECTED]:
>>
>> 
>>> jpeg2yuv -v0 -f25 -n1 -Ip -j.jpg | yuvscaler -v0 -OSIZE_720x576 2>
>>> /dev/null |
>>> mpeg2enc -v0 -a2 -np --cbr -b1 -D8 -f3 -o .mvi
>>>
>>> from mjpeg-tools
>>>
>>> It works fine only for about one out of 5 pictures I got an errormessage
>>> like: jpegdata ended unexpectedly and the mpeg2-File contains only the
>>> upper portiohn of the picture the rest is gray, all the JPEGSs can be
>>> shown with several different viewers under Windows and Linux without any
>>> problems. Why mjpegtools does not process these JPEGs properly? Or if they
>>> really are corrupt, why can the viewers show them correctly? Is there any
>>> tool to fir such JPEG-files that they will be accepted by mjpegtools?
>>>
>>>
>>>   
>> Is the file size of those pictures bigger then 1310720 bytes?
>> The size of the picture you can use for jpeg2yuv is max 1310720 bytes:
>> http://www.mail-archive.com/mjpeg-users@lists.sourceforge.net/msg06780.html
>>
>>   Gert
>>
>>
>>
>> -
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> ___
>> Mjpeg-users mailing list
>> Mjpeg-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mjpeg-users
>> 
>
> -
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ___
> Mjpeg-users mailing list
> Mjpeg-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mjpeg-users
>
>
>   


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] aspect-ratio

2007-03-12 Thread Gert Vervoort

> I use mjpegtools to convert JPEGS from a digital-photo-camera to MPEG2s to 
> view them on my settopbox(Dreambox500).
>
> Iuse:
> jpeg2yuv  -v0 -f25 -n1 -Ip -j.jpg   |
> yuvscaler -v0 -OSIZE_720x576 2> /dev/null |
> mpeg2enc  -v0 -a2 -np --cbr -b1 -D8 -f3 -o .mvi
>
> now I would like to maintain teh aspectratio of the fotos and rather fill the 
> rest of the space with black bars, is there any possibility to do this with 
> mjpegtools?
>
>   
y4mscaler can be used for this: 
http://www.mir.com/DMG/Software/y4mscaler.html

e.g. 4:3 photo to 4:3 DVD:
djpeg 20070225_2710.JPG  | ppmtoy4m -r -n 200 -F 25:1 | y4mscaler -I 
sar=1:1 -O preset=DVD -O infer=PRESERVE_X -O infer=EXACT | mpeg2enc -f 8 
-o photo.m2v

e.g. a 4:3 photo to 16:9 DVD (black bars left and right of the picture):
djpeg 20070225_2710.JPG  | ppmtoy4m -r -n 200 -F 25:1 | y4mscaler -I 
sar=1:1  -O preset=DVD_WIDE  | mpeg2enc -f 8 -o photo2.m2v

   Gert



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] Lost frames and signal stabilizers...

2007-03-12 Thread Andrea Giuliano
Steven M. Schultz wrote:
> On Sun, 11 Mar 2007, Andrea Giuliano wrote:
> 
>> At last I bought it, brand new, just the model is CT2, not CT200, but 
>> many people told me they are actually the same item.
>   
>   The CT200 is an upgraded CT2.  CT200 has a couple more "enhancement"
>   modes but the 200 is quite a bit more expensive.

The advertise I read was a bit different, I was a fool to beleave it...

>> The seller told me that the problem could be the european frequency (I 
> 
>   I think he is correct.
...

>> Any hint?
> 
>   Can you try a stepdown transformer?  By that I mean use the power
>   120V -> 7.5V adaptor that came with the CT2  BUT use a transformer
>   to go from 240/220 -> 120V.  It could be the quality of the 7.5V
>   makes a big difference.  

It sounds as a good idea, but can you explain what a "stepdown 
transformer" is? I guess a "transformer" is an equipment that converts 
an alternate current from a voltage to another, but I guess it keeps the 
frequency, and I don't know if that's the same for Europe and USA. Does 
"stepdown" refer to the frequency or just to the reduction of voltage?

Anyway, many thanks for your kind answer.

-- 
Andrea

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] Lost frames and signal stabilizers...

2007-03-12 Thread Steven M. Schultz

On Mon, 12 Mar 2007, Andrea Giuliano wrote:

> It sounds as a good idea, but can you explain what a "stepdown 
> transformer" is? I guess a "transformer" is an equipment that converts 
> an alternate current from a voltage to another

Precisely.  

> frequency, and I don't know if that's the same for Europe and USA. Does 
> "stepdown" refer to the frequency or just to the reduction of voltage?

Leaves the frequency the same.  A stepdown transformer would convert
240V 50Hz AC to 120V 50Hz AC.  The power adaptor that came with the
CT2 should be able to go from that to 7.5V DC

Steven Schultz


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] Lost frames and signal stabilizers...

2007-03-12 Thread stefan
Hi,

Andrea Giuliano schrieb:
> Could it really be this the cause of the problem? It seems questionable 
> to me, because the adapter actually produces a 7.5 volt direct current. 
> Indeed, it could do that not very well, the current may be not so 
> "direct" as CT2 requires, I don't know.
>   
This will most likely be the problem. It is not easy to get a well 
stabilized and filtered DC out of AC. Grounding may be a problem, too.

A good AC -> DC converter with stabilized and AC-free voltage-output 
easily can cost about 40-50(!) €. Anything below will be suspicious to 
make problems with video-equipment...

Before you buy some high-cost converter, you can try with a battery-pack 
of 7.5 V. But _please_ check the voltage before use, as batteries can 
have some higher output, when new.

cu
Stefan

PS: You may otherwise go to a ham-radio-OM near you and dare asking if 
he/she will build you such a converter. These people usually know how to 
make real stable currents... (And usually they have a full measuring 
"park" of instruments to check you device -- vy 73 & tnx :)



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users