Menu

Additional Thoughts

freeko2
2016-05-27
2016-06-07
  • freeko2

    freeko2 - 2016-05-27

    I've already provided these requiest on encode.ru froum but copied here for proper processing:

    **A- Improving MP3 optimizing by optimizing embedded pictures (usually as JPG or PNG) **

    The proper solution using metamp3 (v0.91 i did not test v0.92b5) https://hydrogenaud.io/index.php/topic,49751.0.html (only mp3 now) using the following process:
    

    ** 1- first list types of images available:**

    metamp3 --info "sample.mp3"
    
    look at APIC tag which indicate available picture types (look at end lines): here is a sample:
    
    APIC: []{3=Cover (front)}: image/jpeg, 34641 bytes
    
    so type (covers front ...etc) is known and image format too but i don't trust using format type but rather file signature.
    
    (to find out available types that can be used in mp3 file just run (metamp3 --list-pict-types "sample.mp3")
    
    here is a sample output:
    
    Picture frame types:
    
    0 : Other
    1 : 32x32 pixels 'file icon' (PNG only)
    2 : Other file icon
    3 : Cover (front)
    4 : Cover (back)
    5 : Leaflet page
    6 : Media (e.g. lable side of CD)
    7 : Lead artist/lead performer/soloist
    8 : Artist/performer
    9 : Conductor
    10 : Band/Orchestra
    11 : Composer
    12 : Lyricist/text writer
    13 : Recording Location
    14 : During recording
    15 : During performance
    16 : Movie/video screen capture
    17 : A bright coloured fish
    18 : Illustration
    19 : Band/artist logotype
    20 : Publisher/Studio logotype
    
    so for example i found picture # 3 is available
    
    **2- extract pictures** (metamp3 --save-pict {3}filename "sample.mp3")
    

    ** 3- after optimizing we need to insert it back ** through this command: ( metamp3" --pict {3}filename.jpg "sample.mp3")

    ** 4- also removing pictures from mp3 files** will be with this command (metamp3 --remove APIC "sample.mp3")

    ** based on the above the following options can be added to MP3 settings:

    - Optimize Embedded Pictures
    - Remove (Strip) Embedded Pictures **
    

    B- Improving JPEG compression by adding lossy type through using of smallfry method:

    Adding Jpeg-recompress with smallfry method to JPG files prior other methods is recommended and can be added as an option to JPEG files (even embedded in zipped files including epub)
    
    https://github.com/danielgtaylor/jpeg-archive/releases
    
    jpeg-recompress --method smallfry in.jpg out.jpg
    

    ** based on the above, the following options and be added to JPEG settings:

    - Optimize using lossy method (smallfry) **
    

    C- Improving ePub size though format conversion:

    Adding conversion mode for Gif conversion to PNG but with "gif" file extension is an added feature to epub settings but only still image (single frame image) can be converted and this can be detected and converted by "Optipng" as skips animated files by default
    

    ** based ob the above the following options can be added to epub settings (which does not exist yet):

    - convert still image GIF format into PNG (maintaining the GIF file extension). **
    
     
  • Nikkho

    Nikkho - 2016-05-28

    Thank you for your highly detailed suggestions.

    A. I will take a look to it Will not be trivial to implement nevertheless.
    B. Sounds very nice the lossy JPEG optimization, and not hard to implement.
    C. Is there any plugin doing such ePub optimizations available?

     
  • freeko2

    freeko2 - 2016-05-28

    1- Its not trival but it will complete current MP3 optimizing process. (other users will like it much to squeeze more bytes out their audio collection).
    2- Thank you.
    3- There is no special plugin but this can be added with currently available tools in Fileoptimizer package using the following process:

    - Detecting epub file extension
    - Optipng is added to GIF optimizing process.
    - Once completed file to have GIF extension.
    
     
  • Nikkho

    Nikkho - 2016-06-02

    Thanks again.
    As of r474, I have added ECT to the MP3 support.

     

Log in to post a comment.

MongoDB Logo MongoDB