Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st April 2021, 22:22   #1  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,303
ImageSource problem with Targa files - unedited ones flipped, edited ones unflipped

I used VirtualDub to export an image sequence of Targa (.tga) files. I then edited some of them in Photoshop.

When I use AviSynth and ImageSource to load the sequence, the edited ones are fine but the unedited are vertically flipped.

Anyone know what's up with that, and if there's a way around it?

Here are two of the images - one flips, one doesn't:

https://horman.net/flips.zip
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 21st April 2021, 23:14   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 4,771
flipvertical() ?


I used colorbars().trim(0,-1) to test, and targa uncompressed export

vdub classic 1.10.4 x86 - NOT flipped
vdub classic 1.10.5 x64 - NOT flipped

vdub2 - flipped

So something with vdub2 branch targa exports
poisondeathray is offline   Reply With Quote
Old 21st April 2021, 23:38   #3  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,303
The problem is that it's selective. The Targas I've edited have the opposite "flippage" to the ones that are unedited.

It suggests to me that there is some kind of flag in the Targa that Photoshop is honouring (and removing by "applying" the flip during editing), but ImageSource isn't. If you open the linked images above in Photoshop, both look normal. With ImageSource, one is flipped and one isn't.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 21st April 2021, 23:50   #4  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 4,771
But photoshop "fixes" it when decoding, and it writes out a proper tga.

vdub2 tga ok in libavcodec based - ffmpeg, ffvideosource, lsmash (ie. not flipped) . Imagemagick in vapoursynth ok

Gimp doesn't even display the vdub2 tga . It opens, but it's "transparent" . vdub1 tga's are ok in gimp

djv_view doesn't open the vdub2 tga either (black screen), but vdub classic tga ok


Something up with vdub2 tga's if gimp can't open it properly - I don't think it's specifically limited to an avs/imagesource problem

Last edited by poisondeathray; 22nd April 2021 at 00:05.
poisondeathray is offline   Reply With Quote
Old 22nd April 2021, 04:58   #5  |  Link
patul
Registered User
 
Join Date: Sep 2005
Posts: 127
There's similar event reported of general tga being flipped here. It said"
Quote:
If bits 4 and 5 in the Image Descriptor field (unpadded it would be offset 11h in the file) are zero then the image is "upside down".
Just curious, why tga? ImageWriter can output png.

Last edited by patul; 22nd April 2021 at 08:28. Reason: remove stupid & unrelated rumbling.
patul is offline   Reply With Quote
Old 22nd April 2021, 09:51   #6  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,303
Force of habit I spose. Although TGA output (from VirtualDub, not ImageWriter) is also 4x faster than PNG.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 27th April 2021, 16:52   #7  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 767
It seems I introduced some fixes at the same time as added alpha channel support. The header written by VD2 seem correct, don't know whats wrong with Gimp etc. I use tga 'all my life' and the upside-down flags are first thing to learn about it...
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 27th April 2021, 18:23   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 4,771
ffmpeg seems to support it ok, but ffplay has issues similar to gimp

ffplay -i vdub2.tga => output is "black" screen, like gimp and djv

ffplay -i vdub.tga => output is ok


For mpv, vdub2.tga is "checkerboard" , indicating transparency

for mpv, vdub.tga is ok


The "flip" might be related to alpha channel introduction, or might be separate issue

Last edited by poisondeathray; 27th April 2021 at 18:26.
poisondeathray is offline   Reply With Quote
Old 27th April 2021, 20:09   #9  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 4,771
The transparency /alpha channel is not an issue; it was just a "bad" test input on my part

My original test input was colorbars(), but the alpha channel for RGB32 is with RGB 0,0,0 in the alpha plane

If you check in avisynth

ffvideosource()
showalpha()

vdub.tga shows 255,255,255
vdub2.tga shows 0,0,0

This is the expected output, since the input was actually a 0,0,0 alpha channel - so it should be "transparent"



It's unrelated to the "flip" issue w_m reported - in both RGB24 or RGB32 cases the vdub2 tga output is still flipped with imagesource; vdub tga output not flipped

Gimp is ok with RGB24 from vdub or vdub2 (not flipped, returns expected output)

Last edited by poisondeathray; 27th April 2021 at 20:12.
poisondeathray is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.