Is it possible to uplaod mp4 file via rtmp?

I want to upload mp4 files via RTMP using ffmpeg and tried several times. However, I got the following received error message.

Please help me.

[ffmpeg command]

C:>ffmpeg -i D:\Project\360ActionCam\R0010020_er.MP4 -acodec aac -vcodec libx264 -f mp4 rtmp://52.76.193.11:1935/UploadFromGocoder/myStream

[Error message]

Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

Hello there.

I am not quite sure I understand your question. But here is a guide to use FFMPEG as a live stream encoder, which sounds like what you might be trying to do:

How to use FFmpeg with Wowza Streaming Engine (MPEG-TS)

Regards,

Salvadore

Hello,

You should be able to publish an RTMP stream to a Wowza Streaming Engine application using FFMPEG. Wowza does support an RTMP stream wrapped as MP4, when using H.264 video and AAC audio codecs.

Here is a forum thead where you can find some frequently used FFMPEG commands with a Wowza server: Frequently requested FFMPEG command examples for Wowza

Zoran

Hi,

Thank you for the response. I hope to clarify my question.

First, I want to know why the following ffmpeg command doesn’t work.

Could you confirm if the ffmpeg doesn’t support mp4 over RTMP? or please let me know how to fix it.

C:>ffmpeg -i D:\Project\360ActionCam\R0010020_er.MP4 -acodec aac -vcodec libx264 -f mp4 rtmp://52.76.193.11:1935/UploadFromGocoder/myStream

Instead, flv over RTMP works well with the following command.

  • C:>ffmpeg -i D:\Project\360ActionCam\R0010020_er.MP4 -acodec aac -vcodec libx264 -f flv rtmp://52.76.193.11:1935/UploadFromGocoder/myStream

In addition, does the Wowza media server support mp4 over RTMP?