Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Video detection seems overly fussy #9

Closed
pfriedel opened this issue Nov 20, 2015 · 1 comment
Closed

Video detection seems overly fussy #9

pfriedel opened this issue Nov 20, 2015 · 1 comment
Assignees
Labels

Comments

@pfriedel
Copy link

I'm not sure the best route forward for this - the file autodetection is great when it works, but it seems to stumble a bit, i.e. this is autodetected:

$ file video1.m4v 
video1.m4v: ISO Media, MPEG v4 system, version 2
$ file -i video1.m4v 
video1.m4v: video/mp4; charset=binary

While this is never looked at - Handbrake will gladly convert it, but the script skips it since the mime-type that file -i returns isn't captured by the sed in the FILES=$() builder.

$ file video2.mkv 
video2.mkv: EBML file, creator matroska
$ file -i video2.mkv 
video2.mkv: application/octet-stream; charset=binary

I'm not sure what the right solution is, to be honest, since "application/octet-stream" is a perfectly legitimate mime-type, although not particularly specific. In the meantime I've added the following and am letting HandBrake reject errata:

ADDFILES=$(find "$DIRECTORY" -maxdepth ${options[depth]} -type f -exec file -N -i -- {} + | sed -n 's!: application/[^:]*$!!p')

And changed the file accumulator to:

FILES=( "${FILES[@]}" "${ADDFILES[@]}" "${EXCLUSIVEFILES[@]}" )

My magic is probably dated - it is FC18 after all.

@FallingSnow
Copy link
Owner

I've had a run in with application/octet-stream before, although I found it to difficult to fix before. Now I believe the best plan of attack is simply to add application/octet-stream video extensions to the exclusiveSupportedExtentions. I will add m4v and mkv to the list.

If anyone runs into the problem again, please open an issue containing the extension so I may add it to the master copy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants