Dive/transcoding#521
Conversation
0ab5719 to
9801de9
Compare
|
Okay going to update this to have some proper failing message for Windows and Linux
Linux:
After failure we note that they should have kwiver installed from the VIAME toolkit tools. |
…into DIVE/transcoding
subdavis
left a comment
There was a problem hiding this comment.
Only got about halfway through, need to work on some other stuff today.
| return jobBase; | ||
| } | ||
|
|
||
| function checkMedia( |
There was a problem hiding this comment.
Please make this async and use spawn(), then await a close or error event.
The main thread has a lot of responsibilities, including an IPC server and an express.js server. While ffprobe is running, spawnSync will block the event loop.
https://nodejs.org/en/docs/guides/dont-block-the-event-loop/
There was a problem hiding this comment.
No problem, I think this might of been a holdover from when I was initially coding and didn't have the 'converting...' stuff implemented and thought that displaying should be done immediately.
| } else if (websafeVideoTypes.includes(mimetype)) { | ||
| /* TODO: Kick off video inspection and maybe transcode */ | ||
| } else if (websafeVideoTypes.includes(mimetype) || otherVideoTypes.includes(mimetype)) { | ||
| if (!checkMedia(settings, path) || otherVideoTypes.includes(mimetype)) { |
| updater: DesktopJobUpdater, | ||
| { checkMedia, convertMedia }: { | ||
| checkMedia: (settings: Settings, path: string) => boolean; | ||
| convertMedia: ConvertMedia; |
There was a problem hiding this comment.
I didn't think about it at the time, but this has the added benefit of being really nice to unit test.
| { | ||
| meta: jsonMeta, | ||
| mediaList: srcDstList, | ||
| type: datasetType, |
There was a problem hiding this comment.
type is a member of jsonMeta, this is redundant.
| const extension = datasetType === 'video' ? '.mp4' : '.png'; | ||
| mediaConvertList.forEach((item) => { | ||
| const destLoc = item.replace(jsonMeta.originalBasePath, projectDirAbsPath); | ||
| const destExt = destLoc.replace(npath.extname(item), extension); |
There was a problem hiding this comment.
This is a confusing name. destExt isn't an ext, it's the entire absolute path. Could you make this a more expressive variable name?
| if (existing.transcodingJobKey === transcodingJobKey) { | ||
| existing.transcodingJobKey = undefined; | ||
| } | ||
| _saveAsJson(projectDirInfo.metaFileAbsPath, existing); |
There was a problem hiding this comment.
move save into conditional? Nothing to save otherwise.
Why would the keys not match? Should an error be thrown if this unexpected condition occurs?
Also, _saveAsJson bypasses lock acquisition, so it should not be used. Should probably absorb that function into saveMetadata.
Co-authored-by: Brandon Davis <git@subdavis.com>
subdavis
left a comment
There was a problem hiding this comment.
Tested, works great. After addressing async spawn, this is good to merge.
| if (result.error) { | ||
| throw result.error; | ||
| } | ||
| // TODO: Don't like this, but Windows needs this |
There was a problem hiding this comment.
could you elaborate on why windows needs this?
There was a problem hiding this comment.
ffprobe is located in the context of the VIAME install. You need to run the setup_viame.bat file first to get the proper PATH setup and then you immediately run the ffprobe afterwards. The batch file has a bunch of commands it logs to stdout when running which is added to by the ffprobe. I could try some redirecting of the stdout for the batch file and then see if afterwards if I could get it back. I may look into that to clean this up a bit.
| } | ||
| } | ||
| //Now we need to test for a local install with libx264 | ||
| const localffmpeg = spawnSync('ffmpeg -encoders', { shell: '/bin/bash' }); |
There was a problem hiding this comment.
I missed this in my first pass, but this should be spawn() also. spawnSync should be avoided.
| <span class="primary--text text--darken-1 text-decoration-none"> | ||
| {{ recent.name }} | ||
| </span> | ||
| <span> |
There was a problem hiding this comment.
| <span> | |
| <span class="pl-4"> |
Match padding on other side of converting status
| Close | ||
| </v-btn> | ||
| </template> | ||
| </v-snackbar> |
There was a problem hiding this comment.
kudos for using v-snackbar and not further entrenching the snackbar service.
There was a problem hiding this comment.
This could in the future be moved outside of Recent.vue into a more global location for the Desktop version to return error messages.
Co-authored-by: Brandon Davis <git@subdavis.com>
|
|
Couple remaining concerns that I really didn't notice until aa01b3c (which was an improvement and helped me read the code).
Also, these are sort of in conflict.
In general this is what I'm proposing. Feel free to disagree.
That way, users know exactly where to look when anything goes wrong. Exceptions are the checks that run on the settings page. EDIT: also, in the near future when jobs persist through app restart, I'd like to recover logs from that working directory to show. FWIW: with a trivial modification, all jobs could use |
This is only the
I can modify it so it creates a
|
|
I'll leave it up to you. I would like for transcoding jobs to have their own working dir in the jobs folder, but if we want to come back to that later, I'm fine with it. I can test again and we can merge this. |
ac5411e to
5c2933b
Compare
|
Completed testing on windows, it is properly creating the |
subdavis
left a comment
There was a problem hiding this comment.
Please merge this before I request more arbitrary changes.
transcoding.mp4
Notes:
update-jobipc to signal a conversion job is complete by looking at thebaseJobdata inside of it. This is used to indicate to the user that they can't click on a 'recents' item until it is complete.{and}. I don't like this but it works for right now using the VIAME version of ffmpeg.Linux ffpemg Fallback:
Going to use the new ffmpeg in VIAME if it exists, then the system install ffmpeg and finally fallback to the h264 encoder with linux and cuda if it is installed on the system.