libstreaming icon indicating copy to clipboard operation
libstreaming copied to clipboard

Can libstreaming record in sd card and streaming live video at the same time?

Open sara-M opened this issue 10 years ago • 20 comments

I have done some research and it seems to be a problematic issue. I have not found a clear answer.

Thanks in advance.

sara-M avatar May 30 '14 10:05 sara-M

Are you able to record only with the libstreaming ?

alle1974 avatar Jan 15 '15 12:01 alle1974

Did anyone find the solution of this problem yet? I am also experiencing this issue. Thanks in advance.

nuttee15 avatar Feb 28 '16 12:02 nuttee15

[http://developer.android.com/reference/android/media/MediaMuxer.html](Media Muxer) [http://bigflake.com/mediacodec/EncodeAndMuxTest.java.txt](example code)

It should be possible with this class and code, taking the mediacodec's output and giving it to the muxer before it's sent along the network in MediaCodecInputStream.java, but when I tried the video was very temperamental. It would only play in some video players, only seek to the nearest 30 seconds, and recording locked up some devices. I took it from kickflip's apache sdk, so it's safe to use. I wouldn't use it in production yet, but it's a good place to start. @nuttee15 @alle1974 https://gist.github.com/sbaar/d473583e4cab2b53c41a

sbaar avatar Feb 28 '16 16:02 sbaar

What's solution for this issue? The link from @sbaar has broken, 404 :( Can anyone help to solve this issue? Some link/gist might help.

Thanks for any help.

ririsrismawati avatar Mar 29 '16 09:03 ririsrismawati

@ririsrismawati The link is working if you copy and paste it into the url bar, I don't know why clicking it gives 404 :/

sbaar avatar Mar 29 '16 09:03 sbaar

I also met this problem, I want to record the stream on server and keep the stream preview on client at the same time, anyone has solved this problem?

Thanks, John

yxnyxnyxnyxn avatar Apr 05 '16 03:04 yxnyxnyxnyxn

Hi @sbaar thank you, the url working if I copy and paste it into the url bar. I have seen your gist and make a start with AACStream.java but I still confuse about mMuxer. I want to make sure mMuxer is MediaMuxer isn't it? Can you explain more about mMuxer on AACStream.java?

Thank you before.

ririsrismawati avatar Apr 15 '16 06:04 ririsrismawati

@ririsrismawati mmUxer in the AAC and VideoStream classes is the Muxer class in the gist, which encapsulates a regular MediaMuxer. It relies on video and audio being added with addTrack in MediaCodecInputStream to start recording. Basically, the muxer is intercepting the audio/video to save before the packets are sent out to the network. You want to set the muxer on both AV streams before they start recording like in BroadcastActivity.java so that the muxer recieve the start signals properly from the MediaCodec.

sbaar avatar Apr 15 '16 16:04 sbaar

@sbaar I have added muxer to libstreaming, but I found the record resolution is too small(default:176x144). I want to record higher resolution, and there is no higher resolution need for client preview. But if I modified the videoquality to higher resolution, client preview resolution has also been modified. Could I improve record resolution without modifying client preview resolution?

Thanks you before.

yxnyxnyxnyxn avatar Apr 25 '16 03:04 yxnyxnyxnyxn

I doubt it's possible using this library. You can try setting up a second media codec pair, but that would probably be a lot of work and it may not even be supported to have two encoders going at the same time on a lot of hardware. 320x240 is well supported on all hardware and 640x480 is on nearly all, so if bandwidth is not a limiting factor you can try those.

sbaar avatar Apr 25 '16 08:04 sbaar

@sbaar thanks a lot

yxnyxnyxnyxn avatar Apr 25 '16 09:04 yxnyxnyxnyxn

@yxnyxnyxnyxn I'm struggling to add muxer to libstreaming. Can you please explain me how to do this. I follow to @sbaar but I haven't right idea how to add BroadcastActivity.java class and using 'mMuxer' in other classes.

JayasenaMS avatar Jun 08 '16 03:06 JayasenaMS

Buenas noches, estoy intentando trabajar con este código pero no entiendo donde inicializar el mMuxer alguien puede ayudarme?

ZaitPaulo avatar Feb 22 '17 01:02 ZaitPaulo

@ZaitPaulo Hola, create the muxer and give it to the video and audio tracks just before mClient.startStream(), to use the name given in example 3.

sbaar avatar Feb 22 '17 21:02 sbaar

What is Example 3?

ZaitPaulo avatar Feb 22 '17 21:02 ZaitPaulo

image

Making all the modifications that you indicate in the readme, finally I get the following code where it indicates to me that the setMuxer method is not found in the inputStream

ZaitPaulo avatar Feb 22 '17 21:02 ZaitPaulo

image

Esto me sale en el logcat

ZaitPaulo avatar Feb 23 '17 19:02 ZaitPaulo

@sbaar i m done all the implementation but, i can not understand how to set mMuxer in MediaCodecInputStream.java. my movie.mp4 file is created but its size is 0 B,

ashishBendale777 avatar Apr 18 '18 08:04 ashishBendale777

@ashishBendale777 I'm have similar problem with MediaMuxer, trying to stream remote video and save it to file at the same time. For me problem is - "video stream have no keyframes". Also trying to find the way how to add them.

ioKun avatar Apr 25 '18 11:04 ioKun

@ioKun how you set mMuxer in MediaCodecInputStream.java....?

ashishBendale777 avatar May 02 '18 04:05 ashishBendale777