Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
d6caa6e5
Commit
d6caa6e5
authored
Jul 13, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频转换
parent
6cbc6257
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
MediaHelper.java
...image/src/main/java/com/yanzuoguang/util/MediaHelper.java
+4
-7
TestMediaHelper.java
yzg-util-image/src/test/java/helper/TestMediaHelper.java
+1
-1
No files found.
yzg-util-image/src/main/java/com/yanzuoguang/util/MediaHelper.java
View file @
d6caa6e5
...
...
@@ -102,21 +102,18 @@ public class MediaHelper extends ImageHelper {
);
parameter
.
init
(
grabber
,
recorder
);
try
{
// 开始转换
// recorder.start(grabber.getFormatContext());
recorder
.
start
();
// 转码没有图像
if
(
Frame
)
{
// 开始转换
recorder
.
start
();
Frame
frame
;
while
((
frame
=
grabber
.
grabFrame
(
true
,
true
,
true
,
false
))
!=
null
)
{
// if (grabber.grabPacket() == null) {
// continue;
// }
recorder
.
record
(
frame
);
}
}
else
{
// 开始转换
recorder
.
start
(
grabber
.
getFormatContext
());
avcodec
.
AVPacket
packet
;
long
t1
=
System
.
currentTimeMillis
();
while
((
packet
=
grabber
.
grabPacket
())
!=
null
)
{
recorder
.
recordPacket
(
packet
);
}
...
...
yzg-util-image/src/test/java/helper/TestMediaHelper.java
View file @
d6caa6e5
...
...
@@ -45,7 +45,7 @@ public class TestMediaHelper {
public
void
testConvertSingle
()
throws
IOException
{
String
fileName
=
"100M.mp4"
;
// String fileName = "z001594372388232a3017ad69c82a342.MOV";
testConvert
(
fileName
,
1
,
1
);
testConvert
(
fileName
,
0.5f
,
0.5f
);
}
private
void
testConvert
(
String
fileName
,
float
size
,
float
quote
)
throws
IOException
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment