Skip to content

保存为本地mp4文件的情况下,大约1秒以后画面卡住。 #11

@zfan93

Description

@zfan93

`final TextureView textureView=new TextureView(this);
setContentView(textureView);
videoRecorder=new VideoRecorderImpl(this);
videoRecorder.reset();
// videoRecorder.setOutputUri("rtmp://192.168.16.125:1935/live/livestream");
videoRecorder.setOutputUri(Environment.getExternalStorageDirectory().getAbsolutePath()+"/test.mp4");
videoRecorder.setOutputSize(720,1280);
videoRecorder.setFps(20);
// videoRecorder.setFilter(getDefaultFilter());
videoRecorder.setPreviewDisplay(textureView);
// videoRecorder.enableHardware(true);
videoRecorder.setOnStateListener(new VideoRecorder.OnStateListener() {
@OverRide
public void onStop() {

       }

       @Override
       public void onError(int i, @NotNull String s) {

       }

       @Override
       public void onPrepared(@NotNull Encoder encoder) {
           videoRecorder.start();

       }

       @Override
       public void onRecord(@NotNull Encoder encoder, long l) {

       }
   });
    videoRecorder.prepare();`

打印日志内容为:

E/MuxerImpl: Add audio track
I/MuxerImpl: addAudioTrack 2
E/MuxerImpl: Muxer audio start
V/VideoEncoderImpl: INFO_OUTPUT_FORMAT_CHANGED
E/MuxerImpl: Muxer video start
I/MPEG4Writer: limits: 4294967295/0 bytes/us, bit rate: -1 bps and the estimated moov size 3195 bytes
E/MuxerImpl: Muxer start
I/MPEG4Writer: setStartTimestampUs: 113378
I/MPEG4Writer: Earliest track starting time: 113378
I/MPEG4Writer: setStartTimestampUs: 0
I/MPEG4Writer: Earliest track starting time: 0
E/MPEG4Writer: timestampUs 87139 < lastTimestampUs 120661 for Video track

本地生成的mp4文件一直是3.23k的固定大小。请问是否是我使用方法不对?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions