VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab and copy, convert Blu-ray and DVDs! :)
+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. I downloaded a cute GIF from Twitter, which was in an .MP4 file, of a cat giving CPR to another cat. I do not understand why Twitter calls this a GIF when the source file appears to be .MP4, but okay. I then tried to convert the .MP4 to a .GIF using Easy GIF Animator for Windows, and I get the horrific result in the attached .GIF. It looks like there is some kind of interlacing issue here. Can someone identify what I need to do when creating the GIF to have the color return and the normal frame orientation return?

    Image
    [Attachment 46449 - Click to enlarge]
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Have you looked at the mediainfo of the source file for clues?
    Quote Quote  
  3. Try using mod4 (integer multiples of 4) frame sizes.
    Quote Quote  
  4. Originally Posted by davexnet View Post
    Have you looked at the mediainfo of the source file for clues?
    Here is mediainfo:

    General
    Complete name : Cat-CPR-on-Cat.mp4
    Format : MPEG-4
    Format profile : Base Media / Version 2
    Codec ID : mp42 (mp42/mp41/isom)
    File size : 113 KiB
    Duration : 4 s 200 ms
    Overall bit rate : 220 kb/s
    Encoded date : UTC 2018-08-12 09:34:58
    Tagged date : UTC 2018-08-12 09:34:58

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : Baseline@L3
    Format settings : 1 Ref Frames
    Format settings, CABAC : No
    Format settings, ReFrames : 1 frame
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 4 s 200 ms
    Bit rate : 214 kb/s
    Width : 346 pixels
    Height : 194 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Frame rate : 10.238 FPS
    Minimum frame rate : 10.000 FPS
    Maximum frame rate : 1 000.000 FPS
    Original frame rate : 1 000.000 FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.312
    Stream size : 110 KiB (97%)
    Title : Twitter v1.0-75xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Writing library : x264 core 148
    Encoding settings : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=1 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=2:1.00
    Encoded date : UTC 2018-08-12 09:34:58
    Tagged date : UTC 2018-08-12 09:34:58
    Quote Quote  
  5. Originally Posted by jagabo View Post
    Try using mod4 (integer multiples of 4) frame sizes.
    You were right and this solves the problem.

    What is going on here?
    Quote Quote  
  6. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Some decode codecs mess up on mod 2, I think that's all it is
    Quote Quote  
  7. A lot codecs and programs can't handle mod2 frame sizes.
    Quote Quote  
  8. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    The original video probably had an odd width, and the converter used optimized routines expecting image lines being aligned with WORD (2 byte) or DWORD (4 byte) RAM addresses. The lack of colors confirms this guess, it probably lost RGB color information due to misaligned colors.

    You may have to use a different tool to convert this MP4 to a GIF. Let's see what JASC Animation Shop can do, one moment...

    Enjoy:


    Animation Shop 3 could not read the MP4 directly, but I converted it in VirtualDub2 to an AVI with Ut codec with RGB base, that could be imported.
    Last edited by LigH.de; 13th Aug 2018 at 09:14.
    Quote Quote  
  9. Originally Posted by LigH.de View Post
    The original video probably had an odd width, and the converter used optimized routines expecting image lines being aligned with WORD (2 byte) or DWORD (4 byte) RAM addresses. The lack of colors confirms this guess, it probably lost RGB color information due to misaligned colors.

    You may have to use a different tool to convert this MP4 to a GIF. Let's see what JASC Animation Shop can do, one moment...

    Enjoy:


    Animation Shop 3 could not read the MP4 directly, but I converted it in VirtualDub2 to an AVI with Ut codec with RGB base, that could be imported.
    So your final GIF is beautiful, although the file size is not optimized. But why is animation shop 3 a better tool to create GIFs? It does not look particularly special purpose for this function.
    Quote Quote  
  10. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Why do you say it is not optimized? What kind of optimizations do you expect instead? I could probably squeeze out more bytes, but that may result in visible artifacts. You know, GIF has only a limited number of colors (max. 255 per frame, optimally per whole animation), and if you reduce it further (e.g. 127 or 63), it may cause heavier quantization, popping dithering...

    JASC Animation Shop 3 allows you to tune a bunch of optimization options. After loading a source, try the "Optimization Wizard" in the File menu.

    A pity the moderators deleted the link to the original MP4 file while merging two posts, and I worked earlier on a different PC. Please try to link it again. Then I can upload more versions, trying to reduce the GIF size further.

    Oh, I could determine it: Cat-CPR-on-Cat.mp4, 115,725 bytes

    255 colors: 1,696,322 bytes


    127 colors: 1,441,294 bytes


    63 colors: 1,100,892 bytes


    You can't make an animated GIF with natural content much smaller than an MP4 because MP4 has more efficient compression techniques for natural content. But animated GIFs can be superior for technical animations with a very low number of distinct colors and large areas of exactly the same pixel color.
    Last edited by LigH.de; 13th Aug 2018 at 13:14.
    Quote Quote  
  11. Originally Posted by LigH.de View Post
    Why do you say it is not optimized? What kind of optimizations do you expect instead? I could probably squeeze out more bytes, but that may result in visible artifacts. You know, GIF has only a limited number of colors (max. 255 per frame, optimally per whole animation), and if you reduce it further (e.g. 127 or 63), it may cause heavier quantization, popping dithering...
    At 255 colors your file size is good.

    JASC Animation Shop 3 allows you to tune a bunch of optimization options. After loading a source, try the "Optimization Wizard" in the File menu.
    Do you know if they plan support for MP4 imports? Given how dominant MP4 has become that is unusual that such a sophisticated environment would not support MP4 directly.


    A pity the moderators deleted the link to the original MP4 file while merging two posts, and I worked earlier on a different PC. Please try to link it again. Then I can upload more versions, trying to reduce the GIF size further.

    Oh, I could determine it: Cat-CPR-on-Cat.mp4, 115,725 bytes
    How were you able to find the .MP4 file? I originally had it linked in my original post but then the link showed as broken so I deleted it.
    Quote Quote  
  12. Originally Posted by pone44 View Post
    I do not understand why Twitter calls this a GIF when the source file appears to be .MP4, but okay.
    twitter converts all gifs to mp4

    BTW , a higher quality version of the original commercial is here
    https://vimeo.com/35402870

    A higher quality starting point usually means you have more options to optimize it better ( whatever you're doing, whether it be gif, or something else). It will be cleaner, higher signal to noise ratio in general.

    That mp4 and gif you posted are frame sampled as in fewer frames (the original animation is 23.976p, with roughly 2x the frames for that sequence). But some other common techniques used to reduce filesize are denoising, variable frame timing (e.g. that mp4 and gif has 1 repeat frame at the end, by using variable frame timing, you can cut off that last frame and hold the 2nd last frame 2x longer, reducing the filesize), lossy encoding (not just palette color reduction, but you can "degrade" each frame too), dithering options (some produce smaller filesize with similar visual quality) . These are all quality/filesize tradeoffs, and not all programs necessarily have these types of options. Sometimes you need to use several programs
    Quote Quote  
  13. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Originally Posted by pone44 View Post
    Do you know if they plan support for MP4 imports?
    Certainly not. JASC has been bought by Corel many years ago, and Animation Shop is an abandoned project (it was published in parallel to Paint Shop Pro 9).
    Quote Quote  
  14. Originally Posted by LigH.de View Post
    Originally Posted by pone44 View Post
    Do you know if they plan support for MP4 imports?
    Certainly not. JASC has been bought by Corel many years ago, and Animation Shop is an abandoned project (it was published in parallel to Paint Shop Pro 9).
    So would the Paint Shop Pro 9 product offer the same optimization features for GIF, while better supporting MP4 import?
    Quote Quote  
  15. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    No, PSP9 is just as old as AS3, and it is a single image painting tool, it does not support videos at all. You obviously did not search before asking that...

    I don't know any current GIF animator tools from own experience, AS3 was always sufficient for me. But QGifer may be a tool for your needs (demo video).
    Quote Quote  



Similar Threads