pili-engineering / PLDroidMediaStreaming

PLDroidMediaStreaming 是七牛推出的一款适用于 Android 平台的推流 SDK,支持 RTMP 推流,h.264 和 AAC 编码,硬编、软编支持。具有丰富的数据和状态回调,方便用户根据自己的业务定制化开发。具有直播场景下的重要功能,如:美颜、背景音乐、水印等功能。PLDroidMediaStreaming 是现在目前重点维护的版本,自带采集模块也支持用户自己做采集端。
https://github.com/pili-engineering/PLDroidMediaStreaming/wiki
Apache License 2.0
1.45k stars 460 forks source link

FFmpegMuxer.prepare():I/O error #34

Closed taylor224 closed 9 years ago

taylor224 commented 9 years ago

Hello, I am trying to stream to Youtube Live Server now.

But stream with pldroid is not started with these error.

How can I solve this problem?

And Stream video resolution is 720x1280. How can I change this resolution to 1280x720?

Thank you

Error about stream not starting problem

I am trying to connect rtmp.youtube.com/live2 so I id: "live2" , title: "live2", hub: "/" make pldroid try to connect rtmp://rtmp.youtube.com///live2?key=secret Please fix to able to insert blank in hub or id value.

09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo I/StreamingBaseActivity﹕ onStateChanged state:5
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo I/Choreographer﹕ Skipped 33 frames!  The application may be doing too much work on its main thread.
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 720] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ new size=691x1230 + padding 0x0
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 691] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ aspect ratio is good (target=0.5625, view=691x1230)
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/CameraStreamingManager﹕ startStreaming mRecordingEnabled=false,mIsPreviewReady=true,mIsOnlyAudioStreaming=false
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/Muxer﹕ Created muxer for output: rtmp://rtmp.youtube.com///live2?key=secret
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/CameraStreamingManager﹕ muxerStatusUpdate muxerState:PREPARING,TID:1571,isNeedUpdateProfile:false
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/StreamingBaseActivity﹕ onStateChanged state:0
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/FFmpegMuxer﹕ mBufferTimeLevelLow:200,mBufferTimeLevelHigh:800,mBufferTimeLevelFull:3000,mBufferTimeLevelLowTimeout:20000
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/FFmpegMuxer﹕ mIsOnlyAudioStreaming=false
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ init
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ is_pure_audio_streaming=0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ initializing output_fmt_context ...
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ _init_output_fmt_context format: flv path: rtmp://rtmp.youtube.com///live2?key=secret
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->name: flv
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->long_name: FLV (Flash Video)
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->mime_type: video/x-flv
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->extensions: flv
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->audio_codec: 86018
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->video_codec: 28
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->subtitle_codec: 0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->flags: 132160
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ adding video stream ...
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->name: h264
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->long_name: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->type: 0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->id: 28
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->capabilities: 12322
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ _add_stream at index 0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ _add_stream: using separate headers
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ _add_stream st: 0x5d946ac0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ adding audio stream ...
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->name: aac
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->long_name: AAC (Advanced Audio Coding)
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->type: 1
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->id: 86018
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->capabilities: 1026
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ _add_stream at index 1
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ _add_stream: using separate headers
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ _add_stream st: 0x5fe4cc90
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ opening output url ...
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ Opening output file for writing at path rtmp://rtmp.youtube.com///live2?key=secret
09-08 23:42:12.315  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 720] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.315  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ new size=691x1230 + padding 0x0
09-08 23:42:12.315  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 691] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.315  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ aspect ratio is good (target=0.5625, view=691x1230)
09-08 23:42:12.320  12616-13049/com.pili.pldroid.streaming.camera.demo E/pili﹕ Handshaking...
09-08 23:42:12.405  12616-13049/com.pili.pldroid.streaming.camera.demo E/pili﹕ Type answer 3
09-08 23:42:12.405  12616-13049/com.pili.pldroid.streaming.camera.demo E/pili﹕ Server version 4.0.0.1
09-08 23:42:12.405  12616-13049/com.pili.pldroid.streaming.camera.demo E/pili﹕ Proto = rtmp, path = ///live2?key=secret, app = /, fname = live2?key=secret
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo E/pldroid_ffmpegbridge﹕ ERROR: ffmpegcore_prepare_stream error -- I/O error
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ logging (dumping) output_fmt_ctx log ...br_ctx=0x5d946490
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ Output #0, flv, to 'rtmp://rtmp.youtube.com///live2?key=secret':
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ Stream #0:0
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ , 0, 0/0
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ : Video: h264, yuv420p, 720x1280, q=2-31, 1228 kb/s
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ , 30 tbc
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ [ 09-08 23:42:12.555 12616:13049 D/pldroid_ffmpegbridge ]
    Stream #0:1
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ , 0, 1/44100
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ : Audio: aac, 44100 Hz, 1 channels, s16, 98 kb/s
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ [ 09-08 23:42:12.555 12616:13049 E/pldroid_ffmpegbridge ]
    ERROR: init error -- I/O error
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo E/FFmpegMuxer﹕ FFmpegMuxer.prepare():I/O error
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo I/CameraStreamingManager﹕ muxerStatusUpdate muxerState:IOERROR,TID:1571,isNeedUpdateProfile:false
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo I/StreamingBaseActivity﹕ onStateChanged state:5
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo I/StreamingBaseActivity﹕ res:false
09-08 23:42:12.560  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 720] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.560  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ new size=691x1230 + padding 0x0
09-08 23:42:12.560  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 691] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.560  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ aspect ratio is good (target=0.5625, view=691x1230)
09-08 23:53:58.890  12616-12616/com.pili.pldroid.streaming.camera.demo D/CameraStreamingManager﹕ onPause +
09-08 23:53:59.070  12616-12616/com.pili.pldroid.streaming.camera.demo I/CameraStreamingManager﹕ releaseCamera -- done
09-08 23:53:59.070  12616-12616/com.pili.pldroid.streaming.camera.demo D/CameraSurfaceRenderer﹕ renderer pausing -- releasing SurfaceTexture
09-08 23:53:59.100  12616-12616/com.pili.pldroid.streaming.camera.demo D/CameraStreamingManager﹕ onPause -
jpxiong commented 9 years ago

At present, sdk need Stream object from pili streaming cloud.