1 | !include once #1017982 // JAVE/ffmpeg |
2 | |
3 | static void cutVideo_jave(S inVideo, S outVideo, float offsetSeconds, float durationSeconds) { |
4 | cutVideo_jave(toFile(inVideo), toFile(outVideo), offsetSeconds, durationSeconds); |
5 | } |
6 | |
7 | static void cutVideo_jave(File inVideo, File outVideo, float offsetSeconds, float durationSeconds) ctex { |
8 | new EncodingAttributes attrs; |
9 | attrs.setOffset(offsetSeconds); |
10 | attrs.setDuration(durationSeconds); |
11 | //attrs.setVideoAttributes(new VideoAttributes); |
12 | new AudioAttributes audio; |
13 | audio.setCodec("libmp3lame"); |
14 | audio.setBitRate(128000); |
15 | audio.setChannels(2); |
16 | audio.setSamplingRate(44100); |
17 | attrs.setAudioAttributes(audio); |
18 | File tempOut = appendToFileName(outVideo, ".temp"); |
19 | print("Cutting " + f2s(inVideo) + " to " + f2s(outVideo) + " (" + durationSeconds + " seconds)"); |
20 | new Encoder().encode(inVideo, tempOut, attrs); |
21 | forceRenameFile(tempOut, outVideo); |
22 | print(" [done]"); |
23 | } |
Began life as a copy of #1018574
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019781 |
Snippet name: | cutVideo_jave (dev.) |
Eternal ID of this version: | #1019781/7 |
Text MD5: | 9b6ccad36ab481d5ba0bf4f107eb0241 |
Author: | stefan |
Category: | javax / audio |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-11-26 04:13:27 |
Source code size: | 947 bytes / 23 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 348 / 370 |
Version history: | 6 change(s) |
Referenced in: | [show references] |