I am using ffmpeg to stream data to rtmp server

ffmpeg -re -i /home/mahesh/Desktop/output.mp4 -c copy -f mp4 udp://

For some reason it is throwing the below error

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/mahesh/Desktop/output.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.71.100
  Duration: 00:00:30.04, start: 0.000000, bitrate: 1394 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1024x960 [SAR 1:1 DAR 16:15], 1392 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
      handler_name    : VideoHandler
[mp4 @ 0x22a1640] muxer does not support non seekable output
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
    Last message repeated 1 times

Cant get where I am going wrong. Please help

1 Answer 1


A regular MP4 can't be streamed. A fragmented MP4 can.

Basic command is

ffmpeg -re -i /home/mahesh/Desktop/output.mp4 -c copy -movflags +frag_keyframe -f mp4 udp://

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .