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

Add "Auto Stream Copy" #16

Closed nschlia closed 5 years ago

nschlia commented 5 years ago

See #9.

mufunyo commented 5 years ago

I have found the following list of codecs that are supported by the QuickTime (MOV) container, which would be able to be copied without having to transcode them:

https://www.norpix.com/applications/applecodecs.php

Note that the list seems to be too old to include h.265/HEVC, which is also a supported codec in the MOV container.

mufunyo commented 5 years ago

I also found another list:

http://codec.kiev.ua/quicktime.html

Cross-referencing both lists, combined with some quick google-fu resulted in the following comprehensive list of ffmpeg vcodecs that should be supported by MOV when simply copied without transcoding:

8bps          QuickTime 8BPS video
012v          Uncompressed 4:2:2 10-bit
aic           Apple Intermediate Codec
avrp          Avid 1:1 10-bit RGB Packer
avui          Avid Meridien Uncompressed
cfhd          Cineform HD
cinepak       Cinepak
dnxhd         VC3/DNxHD
dpx           DPX (Digital Picture Exchange) image
flic          Autodesk Animator Flic video
flv           FLV / Sorenson Spark / Sorenson H.263 (Flash Video) (codec flv1)
h261          H.261
h263          H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2
h264          H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
hevc          HEVC (High Efficiency Video Coding)
hq_hqa        Canopus HQ/HQA
hqx           Canopus HQX
indeo2        Intel Indeo 2
indeo3        Intel Indeo 3
indeo4        Intel Indeo Video Interactive 4
indeo5        Intel Indeo Video Interactive 5
jpeg2000      JPEG 2000
magicyuv      MagicYUV video
mjpeg         MJPEG (Motion JPEG)
mjpegb        Apple MJPEG-B
mpeg1video    MPEG-1 video
mpeg2video    MPEG-2 video
mpegvideo     MPEG-1 video (codec mpeg2video)
mpeg4         MPEG-4 part 2
prores        ProRes
qdraw         Apple QuickDraw
qtrle         QuickTime Animation (RLE) video
r10k          AJA Kona 10-bit RGB Codec
r210          Uncompressed RGB 10-bit
rpza          QuickTime video (RPZA)
smc           QuickTime Graphics (SMC)
svq1          Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1
svq3          Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3
targa         Truevision Targa image
tiff          TIFF image
v210          Uncompressed 4:2:2 10-bit
v210x         Uncompressed 4:2:2 10-bit
v308          Uncompressed packed 4:4:4
v408          Uncompressed packed QT 4:4:4:4
v410          Uncompressed 4:4:4 10-bit
vp3           On2 VP3
vp5           On2 VP5
vp6           On2 VP6
vp6a          On2 VP6 (Flash version, with alpha channel)
vp6f          On2 VP6 (Flash version)
vp7           On2 VP7
vp8           On2 VP8
vp9           Google VP9
mufunyo commented 5 years ago

For MP4, the list is much shorter, as only MPEG standardised codecs are supported as far as I know.

h261          H.261
h263          H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2
h264          H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
hevc          HEVC (High Efficiency Video Coding)
mpeg1video    MPEG-1 video
mpeg2video    MPEG-2 video
mpegvideo     MPEG-1 video (codec mpeg2video)
mpeg4         MPEG-4 part 2
nschlia commented 5 years ago

I think mpeg1/2 is not supported by MP4, at least when I tried to repackage some files with FFmpeg, using -c:v copy. But I'll give it a try.

nschlia commented 5 years ago

I think mpeg1/2 is not supported by MP4, at least when I tried to repackage some files with FFmpeg, using -c:v copy. But I'll give it a try.

Not true.... MP4 does support MPEG1/2 video:

See https://de.wikipedia.org/wiki/MP4

nschlia commented 5 years ago

Function extended, --autocopy now supports:

Option Description
OFF Never copy streams, transcode always.
MATCH Copy stream if target supports codec.
MATCHLIMIT Same as MATCH, only copy if target not larger, transcode otherwise.
STRICT Copy stream if codec matches desired target, transcode otherwise.
STRICTLIMIT Same as STRICT, only copy if target not larger, transcode otherwise.