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
206 stars 14 forks source link

[FEATURE] Smart conversion option ("Smart Transcode") Audio/Video #86

Closed nschlia closed 2 years ago

nschlia commented 3 years ago

Add a "Smart Transcode" option

Smart transcoding currently simply determines the output format by taking the input format type into account, e.g., an MP3 would be recoded to AIFF, an MP4 to MOV even if the input MP4 does not contain a video stream.

The input format should be scanned for streams and the output selected appropriately: An MP4 with video should be transcoded to MOV, an MP4 with audio only to AIFF.

dreirund commented 2 years ago

Would this also solve the fact that when --desttype=MP3+WEBM or --desttype=MP3+MP4, all audio files get transcoded to WebM or MP4?

It would be nice if some transcoding-mappings could also be specified manually by from-to-pairs, e.g. --mapping=<mimetype>:<format> (multiple options possible).

nschlia commented 2 years ago

Would this also solve the fact that when --desttype=MP3+WEBM or --desttype=MP3+MP4, all audio files get transcoded to WebM or MP4?

This would recode audio formats to MP3 and video files to WebM or MP4. Audio only formats will never be recoded to WebM or MP4 in these cases. BTW, --desttype=MP3+MP4 would not make much sense as MP4 can perfectly contain audio only.

Currently the decision whether to target MP3 or WebM is taken by the capabilities of the input format - e.g. WAV or AIFF gets recoded to MP3. AVI or MP4 to WebM, even if the source does not contain video. This is quite dumb.

The enhancement planned would be that a check is added so that a video capable format that contains no video will be transcoded to MP3.

As now the files are checked first for cue sheets the necessary information should be available soon enough. I*ll see if I can implement the feature now,

It would be nice if some transcoding-mappings could also be specified manually by from-to-pairs, e.g. --mapping=<mimetype>:<format> (multiple options possible)

Probably this could be done, but what would be the use case for this?

dreirund commented 2 years ago

Would this also solve the fact that when --desttype=MP3+WEBM or --desttype=MP3+MP4, all audio files get transcoded to WebM or MP4?

This would recode audio formats to MP3 and video files to WebM or MP4.

I observe differently; see issue #99.

nschlia commented 2 years ago

Think that should be possible now. The problem was, the input file must be scanned first to detect video tracks. At the time I implemented this feature this was not done. But now the files get scanned for cue sheets and thus I have the information required.

dreirund commented 2 years ago

:slightly_smiling_face: