File tree Expand file tree Collapse file tree 4 files changed +27
-8
lines changed
java/com/exozet/videoeditor/demo
videoeditor/src/main/java/com/exozet/videoeditor Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -139,12 +139,20 @@ class MainActivity : AppCompatActivity() {
139
139
frameFolder = frameFolder,
140
140
outputUri = outputVideo,
141
141
config = EncodingConfig (
142
- sourceFrameRate = 30 // translates into every input image is a frame in new video
143
- )
142
+ sourceFrameRate = 120f / 63f ,
143
+ outputFrameRate = 30f
144
+ ),
145
+ deleteFramesOnComplete = false
144
146
).subscribeOn(Schedulers .computation())
145
147
.observeOn(AndroidSchedulers .mainThread())
146
148
.subscribe({
147
- logv { " extract frames ${it.progress} ${it.message} ${(it.duration / 1000f ).roundToInt()} s" }
149
+
150
+ merge_frames_progress.show()
151
+ merge_frames_progress.progress = it.progress
152
+
153
+ logv { " extract frames $it " }
154
+
155
+ output.text = " ${(it.duration / 1000f ).roundToInt()} s ${it.message?.trimMargin()} \n ${output.text} "
148
156
149
157
}, {
150
158
logv { " creating video fails ${it.message} " }
Original file line number Diff line number Diff line change 62
62
android : layout_marginStart =" 64dp"
63
63
android : layout_marginEnd =" 64dp"
64
64
android : visibility =" gone"
65
- app : layout_constraintBottom_toTopOf =" @id/stop_process "
65
+ app : layout_constraintBottom_toTopOf =" @id/transcode_video "
66
66
app : layout_constraintEnd_toEndOf =" parent"
67
67
app : layout_constraintStart_toStartOf =" parent"
68
68
app : layout_constraintTop_toBottomOf =" @id/make_video"
Original file line number Diff line number Diff line change @@ -55,11 +55,18 @@ data class EncodingConfig(
55
55
*/
56
56
@IntRange(from = 0 , to = 63 )
57
57
val videoQuality : Int? = null ,
58
+
58
59
/* *
59
- * -r Frame rate of the video.
60
+ * -framerate input Frame rate of the video.
60
61
* https://lists.ffmpeg.org/pipermail/ffmpeg-user/2013-July/016273.html
61
62
*/
62
- val sourceFrameRate : Int? = null ,
63
+ val sourceFrameRate : Float? = 30000f /1001f ,
64
+
65
+ /* *
66
+ * -r output Frame rate of the video.
67
+ * https://video.stackexchange.com/a/13074
68
+ */
69
+ val outputFrameRate : Float? = 30000f /1001f ,
63
70
64
71
/* *
65
72
* pix_fmts
Original file line number Diff line number Diff line change @@ -248,13 +248,17 @@ object FFMpegTranscoder {
248
248
add(" -y" )
249
249
250
250
config.sourceFrameRate?.let {
251
- add(" -r " ); add(" ${config.sourceFrameRate} " )
251
+ add(" -framerate " ); add(" ${config.sourceFrameRate} " )
252
252
}
253
253
254
254
add(" -threads" ); add(" ${Runtime .getRuntime().availableProcessors()} " )
255
+
255
256
add(" -i" ); add(" ${frameFolder.path} /image_%03d.jpg" )
257
+
258
+ add(" -r" ); add(" ${config.outputFrameRate} " )
259
+
256
260
add(" -c:v" ); add(" ${config.encoding} " )
257
- add(" -x264opts" ); add(" keyint=${config.keyInt} :min-keyint=${config.minKeyInt} :no-scenecut" )
261
+ // add("-x264opts"); add("keyint=${config.keyInt}:min-keyint=${config.minKeyInt}:no-scenecut")
258
262
259
263
config.gopValue?.let {
260
264
add(" -g" ); add(" ${config.gopValue} " )
You can’t perform that action at this time.
0 commit comments