IPB

Welcome Guest ( Log In | Register )

> Notice!

Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.

Also make sure you've read the Forum Guidelines before posting in this forum.

 
Reply to this topicStart new topic
> How to decrease the tagsize after deleting coverart
Lupercus
post Sep 4 2009, 16:41
Post #1


Member


Group: Full Members
Posts: 19
Joined: 14-December 07
Member No.: 6117
Mp3tag Version: 2.47a



I just received some FLAC files that had coverart embedded. The .jpg files that were embedded were however way too big: about 4-6 MB per FLAC!
MP3Tag took ages to read these huge tags in the total of 230 files, probably because of these huge tagsizes. So I deleted all coverart via the "extended tags".

However, the tagsize is still indicated to be between 4 and 6 MB per FLAC, even after the deletion of all coverart ...

Is there any way decrease the tagsize ? I already deleted all tags and pressed "undo", without any result.
Go to the top of the page
 
+Quote Post
Lupercus
post Sep 4 2009, 18:21
Post #2


Member


Group: Full Members
Posts: 19
Joined: 14-December 07
Member No.: 6117
Mp3tag Version: 2.47a



After some searching I found that apparently the space in the FLAC used by an embedded image is indeed "padded" when removing the image.

So the question seems to be how to remove this huge padding in the picture metadata block.
I saw that perhaps this could be done with Metaflac, if I understand correctly using the switches: "--remove --block-type=PADDING --dont-use-padding"
Can this be made to work only on the picture metadata?

Alternatively, I saw that there was also a switch "--remove-all --dont-use-padding"
But would this also delete the normal tags such as "title" and I'm not quite sure whether this would also remove existing padding ...

Anyway, this is becoming a bit too technical for me, does someone have any experience with this?

This post has been edited by Lupercus: Sep 4 2009, 20:37
Go to the top of the page
 
+Quote Post
Lupercus
post Sep 5 2009, 13:52
Post #3


Member


Group: Full Members
Posts: 19
Joined: 14-December 07
Member No.: 6117
Mp3tag Version: 2.47a



Sorry to keep answering myself, but I found a solution via metaflac used in a batchfile, that seems to work.

@echo off
title Reduce padding in FLAC - all files in directory
for %%i in (*.flac) do (
echo Removing padding from "%%~ni.flac" ...
"<full-path-to>\metaflac.exe" --remove --block-type=PADDING --dont-use-padding "%%~ni.flac"
if ERRORLEVEL 1 goto error
echo Adding 4096 bytes of padding ...
"<full-path-to>\metaflac.exe" --add-padding=4096 "%%~ni.flac"
if ERRORLEVEL 1 goto error
echo -- Done
echo.
)
echo.
echo -- Padding reduced
goto end
:error
echo.
echo ---- ERROR REDUCING PADDING ---- batch process stopped
:end
echo.
pause
exit

Save this as f.i. "ReduceFLACPadding.bat" and place in the right-context-menu folder of explorer. This will reduce any oversized padding in all FLACs in the directory to a standard 4096 bytes, leaving the existing tags intact.

This post has been edited by Lupercus: Sep 5 2009, 14:03
Go to the top of the page
 
+Quote Post
jorgensen
post Oct 25 2009, 09:32
Post #4


Member


Group: Members
Posts: 3
Joined: 21-July 09
Member No.: 10607
Mp3tag Version: 2.43



I also had audio files with huge cover art, and hopped I could find help here, but not much.
Turned out that J. River Media Center do the job easily, and version 12 is free.
However do not scan to update the library, as Media Center will embed the cover art by default.

This post has been edited by jorgensen: Oct 25 2009, 09:37
Go to the top of the page
 
+Quote Post
DetlevD
post Jan 6 2014, 23:57
Post #5


Member


Group: Full Members
Posts: 5071
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (Lupercus @ Sep 4 2009, 16:41) *
... Is there any way decrease the tagsize ? ...

I'm so free and hijack this thread about the padding size in FLAC files, and want to give thanks to Lupercus for his batch file using the commandline tool "metaflac.exe", which I have used as a template.
I wrote an extended version of the batch file, see attachment.

@ECHO OFF
REM ================================================================================
REM Purpose: Change the padding size within all FLAC files in the given folder .
REM The given folder path name can be dropped onto this batch file ...
REM ... or can be set as the first parameter on the command line.
REM This CMD script is an extended version of the CMD script from Mp3tag user "Lupercus, Sep 5 2009, 13:52" .
REM Detlev Dalitz.20140106.
REM ================================================================================
REM Define the fully qualified path to the file "metaflac.exe".

SET METAFLAC="P:\Programs\FLAC\metaflac.exe"
REM Define the padding default size in Bytes.
REM The pad size is allowed to be an integer value in the range from 0 to 16777215.

SET PADSIZE_DEFAULT=2000
REM ================================================================================
ECHO.[%~nx0]
ECHO.
ECHO.Set padding for all FLAC files in the current folder ...
CD /D "%~f1"
ECHO."%CD%"
IF NOT EXIST "*.FLAC" (
   ECHO.
   ECHO.FLAC files not found.
   GOTO END
)
:GET_PADSIZE

ECHO.
SET PADSIZE_INPUT=%PADSIZE_DEFAULT%
SET /P PADSIZE_INPUT=Give padding size in Bytes (default %PADSIZE_DEFAULT%):
SET /A PADSIZE_EVAL=1*%PADSIZE_INPUT%
IF %PADSIZE_EVAL% NEQ %PADSIZE_INPUT% (
   ECHO.Enter an integer number in the range ...
   ECHO.decimal ...: from 0   to 16777215
   ECHO.hexadecimal: from 0x0 to 0xffffff
   ECHO.octal .....: from 00  to 077777777
   GOTO GET_PADSIZE
)

ECHO.Set padding to %PADSIZE_EVAL% Bytes.
ECHO.
ECHO.Press [Enter] to continue or [Ctrl+C] to exit.
PAUSE >NUL
ECHO
.
SET COUNT=0
FOR %%f IN ("*.FLAC") DO (
   REM ATTRIB -R "%%~nxf"
   REM ECHO."%%~nxf"
   REM ECHO.%%~ftzaf

   SET /A COUNT=!COUNT!+1
   ECHO.
   ECHO.!COUNT!:
   ECHO.Remove padding from ...
   DIR /N/4 "%%f"|FIND "%%f"
   %METAFLAC% --dont-use-padding --remove --block-type=PADDING "%%~nxf"
   IF ERRORLEVEL 1 GOTO ERROR
   ECHO.Add padding %PADSIZE_EVAL% Bytes ...
   %METAFLAC% --add-padding=%PADSIZE_EVAL% "%%~nxf"
   IF ERRORLEVEL 1 GOTO ERROR
   DIR /N/4 "%%f"|FIND "%%f"
   ECHO.
   REM PAUSE
)
ECHO.
ECHO.Ready.
GOTO END
:ERROR

ECHO.
ECHO.Error on reducing padding ... batch process stopped.
:END
ECHO.
PAUSE
EXIT


Attached File  MetaFlac.SetPadding.cmd.txt ( 2.25K ) Number of downloads: 146

For usage remove the extension ".txt" from the filename.

DD.20140106.2356.CET


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
FreaQ
post Dec 2 2014, 10:01
Post #6


Member


Group: Full Members
Posts: 50
Joined: 30-September 10
Member No.: 13005
Mp3tag Version: 2.58



Hi Detlev,

I really like your script.

But I get two "errors". The Script itself works fine.

QUELLTEXT
Set padding for all FLAC files in the current folder ...
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
"F:\__Comedy\Badesalz\[1991-00-00] Nicht Ohne Meinen Pappa"


And before every file:

QUELLTEXT
Fehlender Operator


The only thing I did was to change the path to the metaflac.exe.


Also I would appreciate it if instead of stopping the script on an error to put the errornous file into a txt-file. Full qualified path + txt-file can be written to any location and not just the source directory.

This post has been edited by FreaQ: Dec 2 2014, 10:02
Go to the top of the page
 
+Quote Post
DetlevD
post Dec 2 2014, 13:48
Post #7


Member


Group: Full Members
Posts: 5071
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (FreaQ @ Dec 2 2014, 10:01) *
... I get two "errors". The Script itself works fine. ... The only thing I did was to change the path to the metaflac.exe. ...

I have just no time to dig into the problem.

Maybe the path to the metaflac.exe file contains one ore more space characters? Do avoid this.
Or ... try to enclose the DOS variable into Double Apostrophes.
%METAFLAC% ==> "%METAFLAC%"
I don't know if this can help.

Feel free to modify the batch script to your needs.

DD.20141202.1348.CET


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st December 2014 - 13:45