Movie annotation and export as avi

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Movie annotation and export as avi

Marion Bétizeau
Dear ImageJ list,

I would like to annotate a timelapse movie composed of tiffs with arrows of different colors and then export it as a movie.

So far I am using the arrow tool from the image, stack, timelapse arrow labeling. It is not the most convenient tool. Does anyone know any other plug-In that would do the job?

For the export, I am using the SaveAsMovie plug in and I save the stack as an .avi with excellent quality and as codec : raw. It works fine when I save the movie without annotation but does a really weir thing when I save it with annotation. The image is distorted and stripes are added when I try to open it with VLC. When I try to open it with ImageJ I get an error message: "An error ocurred reading the AVI file. Odd size (77x196) unsupported with I420 compression".

Has anyone encountered this problem already?

Best regards,

Marion
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Movie annotation and export as avi

Michael Schmid
Hi Marion,

for good compatibility with other programs you should never save an AVI file with a side length that is not a multiple of 2. Some codecs even require that the width and height must be a multiple of 4.

By the way, ImageJ can also save a raw AVI from the 'Save As' menu, but not with I420 chroma subsampling. ImageJ 1.46f and later can read I420, but there may be problems if width and height are not multiples of 2 because I420 is not well-defined in such a case.

---

Concerning Labelling: Depends what you want. For overlay tools such as the arrow tool or text tool, you can put the arrow, type (CTRL-) D, and use the shortcut (.) to go to the next slice, maybe the cursor keys to move the arrow, press (CTRL-) D again, etc.  That's not so inconvenient for me!


Michael
________________________________________________________________
On Jun 21, 2013, at 18:08, Marion Bétizeau wrote:

> Dear ImageJ list,
>
> I would like to annotate a timelapse movie composed of tiffs with arrows of different colors and then export it as a movie.
>
> So far I am using the arrow tool from the image, stack, timelapse arrow labeling. It is not the most convenient tool. Does anyone know any other plug-In that would do the job?
>
> For the export, I am using the SaveAsMovie plug in and I save the stack as an .avi with excellent quality and as codec : raw. It works fine when I save the movie without annotation but does a really weir thing when I save it with annotation. The image is distorted and stripes are added when I try to open it with VLC. When I try to open it with ImageJ I get an error message: "An error ocurred reading the AVI file. Odd size (77x196) unsupported with I420 compression".
>
> Has anyone encountered this problem already?
>
> Best regards,
>
> Marion
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Movie annotation and export as avi

Rodrigo Gonçalves-4
In reply to this post by Marion Bétizeau
I have also noticed that: when opening an AVI file  (generated with imageJ) in VLC I see it diagonally stretched and with stripes. But when I open it with QuickTime it works fine, so maybe it is a VLC-related issue..

Cheers,
Rodrigo

________________________

Rodrigo J. Gonçalves

________________________

--- El vie, 6/21/13, Marion Bétizeau <[hidden email]> escribió:

De: Marion Bétizeau <[hidden email]>
Asunto: Movie annotation and export as avi
A: [hidden email]
Fecha: viernes, 21 de junio de 2013, 05:08 pm

Dear ImageJ list,

I would like to annotate a timelapse movie composed of tiffs with arrows of different colors and then export it as a movie.

So far I am using the arrow tool from the image, stack, timelapse arrow labeling. It is not the most convenient tool. Does anyone know any other plug-In that would do the job?

For the export, I am using the SaveAsMovie plug in and I save the stack as an .avi with excellent quality and as codec : raw. It works fine when I save the movie without annotation but does a really weir thing when I save it with annotation. The image is distorted and stripes are added when I try to open it with VLC. When I try to open it with ImageJ I get an error message: "An error ocurred reading the AVI file. Odd size (77x196) unsupported with I420 compression".

Has anyone encountered this problem already?

Best regards,

Marion
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Movie annotation and export as avi

Marion Bétizeau
Thanks a lot Rodrigo. I can open it with quicktime if I save as .mov (it doesn't if I save as .avi) and it looks ok but the compression is very high. I lose a lot of quality compared to the tifs. Do you know how I could improve it?

Cheers,

Marion


Le 25 juin 2013 à 11:22, Rodrigo Gonçalves <[hidden email]> a écrit :

> I have also noticed that: when opening an AVI file  (generated with imageJ) in VLC I see it diagonally stretched and with stripes. But when I open it with QuickTime it works fine, so maybe it is a VLC-related issue..
>
> Cheers,
> Rodrigo
>
> ________________________
>
> Rodrigo J. Gonçalves
>
> ________________________
>
> --- El vie, 6/21/13, Marion Bétizeau <[hidden email]> escribió:
>
> De: Marion Bétizeau <[hidden email]>
> Asunto: Movie annotation and export as avi
> A: [hidden email]
> Fecha: viernes, 21 de junio de 2013, 05:08 pm
>
> Dear ImageJ list,
>
> I would like to annotate a timelapse movie composed of tiffs with arrows of different colors and then export it as a movie.
>
> So far I am using the arrow tool from the image, stack, timelapse arrow labeling. It is not the most convenient tool. Does anyone know any other plug-In that would do the job?
>
> For the export, I am using the SaveAsMovie plug in and I save the stack as an .avi with excellent quality and as codec : raw. It works fine when I save the movie without annotation but does a really weir thing when I save it with annotation. The image is distorted and stripes are added when I try to open it with VLC. When I try to open it with ImageJ I get an error message: "An error ocurred reading the AVI file. Odd size (77x196) unsupported with I420 compression".
>
> Has anyone encountered this problem already?
>
> Best regards,
>
> Marion
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Movie annotation and export as avi

Michael Schmid
Hi Marion, Rodrigo,

for AVI files written as in raw format by Save As>AVI, the skewed ('diagonal') appearance is clearly a bug in VLC.

The problem is the following:

The AVI format is based on Microsoft's bitmap (BMP); there it is specified that lines should be padded to integer multiples of 4 bytes.  ImageJ does this, and most other programs read it correctly (including Microsoft Media Player, which should adhere to the Microsoft standard, I guess).  These programs don't read it correctly if padding is omitted.

VLC (at least version 2.0.7 that I tried) does not know about padding: It requires no padding to read the video correctly (I have eliminated the padding from the ImageJ code, then VLC showed the video correctly, the other programs showed a skewed image).  Note that almost all sources of video deliver image widths and heights that are a multiple of four; in that case the problem does not occur, so it seems to be not a big issue for the developers of VLC.  The VLC bug is strange because VLC uses libavcodec, the library used also by ffmpeg, but I got ffmpeg read ImageJ-created AVI files with odd widths and padding (as it should be) correctly.

There is no such problem if the width of the image is an integer multiple of 4.

Therefore it is best to use image widths (and heights) that are a multiple of four when the data should be exported as a movie - either truncate (crop) the image or enlarge the canvas with a black rim.  Note that many video codecs explicitly demand sizes that are integer multiples of 4, so a video file with a different width or height cannot be converted to most other video formats.  Some codecs even need multiples of 8.

Michael
________________________________________________________________
On Jun 25, 2013, at 15:04, Marion Bétizeau wrote:

> Thanks a lot Rodrigo. I can open it with quicktime if I save as .mov (it doesn't if I save as .avi) and it looks ok but the compression is very high. I lose a lot of quality compared to the tifs. Do you know how I could improve it?
>
> Cheers,
>
> Marion
>
>
> Le 25 juin 2013 à 11:22, Rodrigo Gonçalves <[hidden email]> a écrit :
>
>> I have also noticed that: when opening an AVI file  (generated with imageJ) in VLC I see it diagonally stretched and with stripes. But when I open it with QuickTime it works fine, so maybe it is a VLC-related issue..
>>
>> Cheers,
>> Rodrigo
>>
>> ________________________
>>
>> Rodrigo J. Gonçalves
>>
>> ________________________
>>
>> --- El vie, 6/21/13, Marion Bétizeau <[hidden email]> escribió:
>>
>> De: Marion Bétizeau <[hidden email]>
>> Asunto: Movie annotation and export as avi
>> A: [hidden email]
>> Fecha: viernes, 21 de junio de 2013, 05:08 pm
>>
>> Dear ImageJ list,
>>
>> I would like to annotate a timelapse movie composed of tiffs with arrows of different colors and then export it as a movie.
>>
>> So far I am using the arrow tool from the image, stack, timelapse arrow labeling. It is not the most convenient tool. Does anyone know any other plug-In that would do the job?
>>
>> For the export, I am using the SaveAsMovie plug in and I save the stack as an .avi with excellent quality and as codec : raw. It works fine when I save the movie without annotation but does a really weir thing when I save it with annotation. The image is distorted and stripes are added when I try to open it with VLC. When I try to open it with ImageJ I get an error message: "An error ocurred reading the AVI file. Odd size (77x196) unsupported with I420 compression".
>>
>> Has anyone encountered this problem already?
>>
>> Best regards,
>>
>> Marion
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Movie annotation and export as avi

Antoinette
.NET image annotator can be used to add and draw over ten kinds of annotation shapes on multipe image and document formats, like annotation on TIFF file, annotation to PDF document and annotation to Microsoft Word, Excel and PowerPoint files.