Ffmpeg encoder Filename Extension Stripping Issue


I apologize if this is a weird one to explain, I’ll do my best.

Issue: Member uploads a file from a very popular movie editor that saves filenames like this:

-rw-r--r-- 1 root root 16355084 Oct 22 20:08 trim.5F7F375E-36EA-4ECA-B706-C8AD83572EA5.MOV
-rw-r--r-- 1 root root  7559763 Oct 23 14:13 trim.7519551E-0059-4968-8EB4-333D62C7598E.MOV
-rw-r--r-- 1 root root 16355084 Oct 22 17:38 trim.7DEF6534-5FDB-4F52-BCDB-65FEB9AB09BC.MOV
-rw-r--r-- 1 root root  8265702 Oct 23 04:40 trim.867D89CB-996D-4313-8532-266AB09503E1.MOV
-rw-r--r-- 1 root root 25776492 Oct 23 02:14 trim.8AB987F3-1248-4B10-B660-4201C98ABDD8.MOV
-rw-r--r-- 1 root root  1782936 Oct 23 04:49 trim.8BD95728-4AC9-439E-A198-F9D7DE056ED3.MOV
-rw-r--r-- 1 root root 42092018 Oct 23 15:54 trim.9A457327-0FD0-4E82-A4BB-B53FCB9F1F35.MOV
-rw-r--r-- 1 root root  3813999 Oct 23 11:11 trim.9B411645-BE39-42E6-9297-3FA25971EC80.MOV
-rw-r--r-- 1 root root 83416778 Oct 23 04:33 trim.A902E60D-B759-47D9-8F8E-75BB9E2C3187.MOV
-rw-r--r-- 1 root root 25776492 Oct 23 02:36 trim.BAAD04D2-CF6E-4CD5-8646-4330E25675CF.MOV
-rw-r--r-- 1 root root  8265702 Oct 23 05:21 trim.D683B44F-0561-4169-8CF4-BAA7ECED02F6.MOV
-rw-r--r-- 1 root root 42092018 Oct 23 15:26 trim.F8424DAB-4D8F-405B-9A48-A6E5755272AF.MOV

No worries, right? It’s a valid filename.

Problem is, when the ffmpeg encoder sends it to the /completed directory, it calls it “trim.mp4”. In fact, it calls ALL of them trim.mp4 and keeps overwriting things.

-rw-r--r-- 1 root root    67417 Oct 23 15:55 trim0.jpg
-rw-r--r-- 1 root root    55848 Oct 23 15:55 trim1.jpg
-rw-r--r-- 1 root root    47851 Oct 23 15:55 trim2.jpg
-rw-r--r-- 1 root root 13060939 Oct 23 15:55 trim.mp4

So now instead of having 14 videos, we have one. Ouch! That’s not good. :smile:

Is the “trim(.)code.MOV” the issue? The ffmpeg plugin should not strip the first “dot/period” it finds, but strip the last one, instead. Then videos will encode successfully and correct files be resent to the server.



I should have mentioned, the directories I listed in the first post to show the filenames are the /queued directory first, and then later in the post the /completed directory as the 3 thumbnails and single movie.



Hi @illusionsglass,

Yes , we have figure out the issue. It will be fixed in future release but if you are in hurry, you can make the changes in media-node by yourself. Here is the link to required changes -> https://github.com/rtCamp/media-node/pull/16/files


Thanks Ritesh. I’ve removed the line and added the two others to the js file. If there’s any problems I’ll report back! Thanks for your attention, as always. Much appreciated.