yasea
yasea copied to clipboard
how to stream rtmp from mp4 file
how to stream rtmp from mp4 file
Use ffmpeg.
ffmpeg -re -i input.mp4 -vcodec libx264 -acodec copy -f flv rtmp://host[:port]/app/stream
Thank u for response sir I know this command sir How I can excute above ffmpeg command in this android library While sample code shows stream from camera
The output of camera is so called raw data, i.e. NV21, NV12, I420...
The output of video encoder is so called ES(encoded stream), i.e. H.264, H.265...
The formats that encapsulate ES are so called containers, i.e. FLV, MP4...
In FFmpeg
, the movements include transferring MP4 format into FLV and wrapping with RTMP. Therefore the actual container under RTMP is FLV but not MP4.
Hello sir iam asking about how to excute ffmpeg command with this library can you tell me the code please
I mean there is no FFmpeg code in this SDK. If you want to stream MP4 files under RTMP. You need to unpack MP4 files as H.264 and the pack it into FLV. The H.264 and AAC sending interfaces are flvMuxer.writeSampleData and flvMuxer.writeSampleData.
Due to I am new for development I am not get you can you tell sample example code to pass mp4 file to stream in rtmp help me sir please
@pratheepchowdhary 解决了吗? 我也想把mp4用rtmp来推流
Hi @begeekmyfriend ! Do You think to update the demo project with this request?