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

Reencode to same file format as source file #25

Closed jhanssen closed 5 years ago

jhanssen commented 5 years ago

Looks like reencoding to the same file format as the source file is not supported? I'd like to convert the video resolution and bitrate of existing mp4 files to new mp4 files. Would it be possible to add support for this?

nschlia commented 5 years ago

Yes, if the source file is already mp4 it will only be copied, not recoded to mp4.

I could add a switch so that they will be recoded (probably only if the target file will not become larger, i.e., not recode a 1 MBit file to 2.5 MBit).

If you want to test it you could rename some files to m4v, in that case they will be recoded

tomdwaggy commented 5 years ago

I personally think it'd be best to have a "never", "always", and "smaller" option with a default to never re-encode.

nschlia commented 5 years ago

I personally think it'd be best to have a "never", "always", and "smaller" option with a default to never re-encode.

That's what I had in mind. I would call the options "never", "always" and "limit" to keep them aligned with --autocopy and other options but that's just what you proposed.

I guess "never", "always" is self explaining, and "limit" means recode only if the original file is larger than the recoded file would be.

nschlia commented 5 years ago

PS:

I am currently preparing release 1.7 (and actually 1.8 which only adds Doxygen documentation), therefore I currently have a feature freeze. I cannot add new features at the moment but I will add it later. The functionality sounds interesting, I would like to have it in FFmpegfs. So please be patient.

nschlia commented 5 years ago

Note: I was busy implementing #26 but this is almost finished now. As side effect I could also add this little feature. It needs to undergo some testing and then I will publish it here.

nschlia commented 5 years ago

Added new --recodesame option. The default behaviour has not changed. You need to set --recodesame=KEEP or --recodesame=ALWAYS to enable.

This will be going to release 1.9, if you want to use it you need to build the FBissue#26 branch.

nschlia commented 5 years ago

Sorry, I closed this one prematurely: The parameters and functionality was implemented, but the setting is not honoured. ffmpegfs still does not recode to the same format no matter which option is set.

Sorry, got confused...

nschlia commented 5 years ago

Enabled the new option, can now be --recodesame=NO (default) or --recodesame=YES to reencode e.g. mp4 to mp4.