Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Reduce cover size when converting from Flac. [need help] (Read 2219 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Reduce cover size when converting from Flac. [need help]

Hello everybody.

I want to convert Flac files using opusenc from the opus tools, applying the images in downsized format to save additional disk space.
My command so far looks like this: opusenc "/path1/file.flac" "path2/file.opus" –bitrate bitrate
Is there a possibility to transfer the images contained in the FLAC file directly during the conversion in resized format?
Since I did not find out, I wanted to proceed like this:
1 Extract images from Flac (works e.g. without loss via exiftool)
2 adjust images (not the problem)
3 overwrite pictures or delete them from Opus and add the modified ones
I just can't get the last step right. The command to write images in Opus files with opusenc fails with my input because I’m unable to get the syntax correct (Error: cannot open file: 0):
opusenc "/path1/file.opus" --picture 0 |||| "/path1/file.jpeg

quote][...] The
  SPECIFICATION is a string whose parts are separated by | (pipe)
  characters. Some parts may be left empty to invoke default values.
  A plain FILENAME is just shorthand for "||||FILENAME".

  The format of SPECIFICATION is:
  [TYPE]|[MEDIA-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILENAME“ [...][/quote]

Also, I don't know how to remove the larger resolution images from the Opus.
For certain reasons I don't want to modify the Flac files, so I don't want to apply the adjustment of the images to them, nor to a copy of them.

I would appreciate a hint for the correct application of the above command. Best would be the possibility to reduce the size of the images directly during the conversion. Otherwise I would have to remove the images before applying the command and would need a nudge in the right direction to do so too. (I don't want to use programs like puddletag or mp3tag because I have to edit many files in bulk.)
>_<

Re: Reduce cover size when converting from Flac. [need help]

Reply #1
I haven't verified myself but i think your quotes are at the wrong place.

Try these commands:
opusenc "/path1/file.opus" --picture "0||||/path1/file.jpeg“
opusenc "/path1/file.opus" --picture "||||/path1/file.jpeg“
opusenc "/path1/file.opus" --picture "||||file.jpeg“

And try this one to remove (avoid) the original picture
--discard-pictures

https://opus-codec.org/docs/opus-tools/opusenc.html

Re: Reduce cover size when converting from Flac. [need help]

Reply #2
The syntax is now correct, I guess.
Now I only get errors that the image files cannot be opened.
Error: cannot open file: '/path1/file.jpeg' or Error: cannot open file: 'file.jpeg' (with both --picture "||||'/path1/file.jpeg'" and --picture "||||'file.jpeg'")
The image format and other image files do not matter.

The option --discard-pictures works fine.
Thanks a lot
>_<

 

Re: Reduce cover size when converting from Flac. [need help]

Reply #3
I have now tried the following syntax, but each time nothing happens with the files, but only opusenc is called and lists all possible commands.
opusenc '/home/user/title.opus'  --picture "||||/home/user/title.jpeg"
opusenc.exe 'D:\title.opus'  --picture "||||D:\title.jpeg"
No matter if Windows or Linux and also with different files.
If anyone knows what this could be due to, I would be grateful.
>_<

Re: Reduce cover size when converting from Flac. [need help]

Reply #4
I have now tried the following syntax, but each time nothing happens with the files, but only opusenc is called and lists all possible commands.
opusenc '/home/user/title.opus'  --picture "||||/home/user/title.jpeg"
opusenc.exe 'D:\title.opus'  --picture "||||D:\title.jpeg"
No matter if Windows or Linux and also with different files.
If anyone knows what this could be due to, I would be grateful.

In case anyone ever has the same trouble:
The command --picture "||||/path/image" works only during conversion. In combination with --discard-pictures the image is then the only image in the Opus.
>_<