nschlia / ffmpegfs

FUSE-based transcoding filesystem with video support from many formats to FLAC, MP4, TS, WebM, OGG, MP3, HLS, and others.
https://nschlia.github.io/ffmpegfs/
GNU General Public License v3.0
198 stars 14 forks source link

All audio files are converted to "video" format if `--desttype` contains `MP3+WEBM` or `MP3+MP4`. #99

Closed dreirund closed 2 years ago

dreirund commented 2 years ago

This is a follow up from → here (issue #86):

What I do:

I mount a directory containing music files with ffmpegfs as follows:

ffmpegfs -o allow_other,ro --max_threads=1 --desttype=MP3+WEBM --autocopy=MATCH --profile=FF --level=STANDARD --hwaccel_enc=VAAPI --hwaccel_dec=VAAPI -f -d /home/music /mnt/ffmpegfs/music/

In that directory I have audio files in the formats OGG/Vorbis, mp3, AAC (without container), and some others.

Problem:

I observe that all the audio files get converted to WebM, and not MP3; even preexisting MP3 get converted to WebM.

Expected behaviour:

Convert at least file formats which are known to be audio only (.mp3, .wav, .flac) to MP3.

Examples:

Original files:

  1. sounds/letter_in_mailbox.ogg
  2. sounds/water.mp3
  3. sounds/silence/flac/silence-010s.flac
  4. sounds/silence/flac/silence-060s.wav
  5. Hannes_Wader/Der_Rattenfaenger/01_-_Der_Rattenfaenger.aac
  6. Klassik/Bedrich_Smetana/Smetana_-_Vltava.mp4

Files in ffmpegfs mount:

  1. sounds/letter_in_mailbox.ogg.webm
  2. sounds/water.mp3.webm
  3. sounds/silence/flac/silence-010s.flac.webm
  4. sounds/silence/flac/silence-060s.wav.webm
  5. Hannes_Wader/Der_Rattenfaenger/01_-_Der_Rattenfaenger.aac.webm
  6. Klassik/Bedrich_Smetana/Smetana_-_Vltava.mp4.webm

More detailed investigation for 1. sounds/letter_in_mailbox.ogg:

Original file:
File in ffmpegfs mount:

Further remarks:

Software version:

nschlia commented 2 years ago

This is not a bug, the correct format would be --desttype=WEBM+MP3 or --desttype=MP4+MP3, the video format must be specified first.

For example, with --desttype=WEBM+MP3 all MP3/WAV files are converted to MP3, and MP4 to WebM, as expected.

I'll add a check, if an audio only format is specified first, the command line will be rejected with an error message.

dreirund commented 2 years ago

This is not a bug, the correct format would be --desttype=WEBM+MP3 or --desttype=MP4+MP3, the video format must be specified first.

Thanks, that explains things and now it works as expected.

OGG files get converted to videos, maybe because it is a container that might contain video at all.

(file sounds/letter_in_mailbox.ogg says
sounds/letter_in_mailbox.ogg: Ogg data, Vorbis audio, mono, 11025 Hz, ~29000 bps, created by: Xiph.Org libVorbis I (1.0.1)
though, so it looks like that already at that point can be determined that there is only audio, but I think this will be tackled by issue #86.)

Thanks for the clarification, and

I'll add a check, if an audio only format is specified first, the command line will be rejected with an error message.

thanks for the wrong-input handling!

-- Machen ist wie wollen, nur krasser.

nschlia commented 2 years ago

OGG files get converted to videos, maybe because it is a container that might contain video at all.

Yep. OGG is video capable. FFmpegfs handles the formats quit dumb. For example, using using --desttype=WEBM+MP3: MP3, AIFF, WAV - make MP3s. WebM, AVI, MP4, OGG - make WebM.

I'll enhance that as with issue #86.

Thanks for the clarification, and thanks for the wrong-input handling!

You're welcome!