[FFmpeg-user] ffmpeg can't stream video using rtsp ... Could not write header for output file #0

Rodney Baker rodney.baker at iinet.net.au
Thu Oct 1 17:42:00 CEST 2015


On Wed, 30 Sep 2015 10:02:43 Roman Rusconi wrote:
> Hello.
> 
> 
> 
> I'm trying to re stream an rtsp stream using ffmpeg.
> 
> I have no problem getting the original rtsp stream and write it to a file,
> although I can't get ffmpeg to stream this video again using rtsp.
> 
> Everything seems fine until the point ffmpeg gets stuck and only stops if I
> press CTRL-C, at this point I get an error message saying:
> 
> 
> 
> "Could not write header for output file #0 (incorrect codec parameters ?):
> Immediate exit requested"
> 

This line here...

> 
> [rtsp @ 00000000066a3900] Codec for stream 0 does not use global headers but
> container format requires global headers
> 

...and this line here...

> Could not write header for output file #0 (incorrect codec parameters ?):
> Immediate exit requested
> 
> Exiting normally, received signal 2.
.
...would appear to be related. Check your command line parameters. The order of 
options is significant. 

However, the errors may be misleading - you do seem to have an error in your 
command line. RTSP and RSTP are two different protocols: 

>ffmpeg.exe -v debug -stats -i rtsp://192.168.1.40/rus -vcodec copy -an -f
>rtsp -c copy rstp://localhost:554/video                     ^^^^
Try correcting the url for the output stream first. 

Having said all that, I'm not an expert - some of the dev's do watch this list and have a 
much better idea of how these things work, so if this doesn't help, hopefully someone 
else can. :)

Regards,
Rodney.

-- 
===========================================================
===
Rodney Baker VK5ZTV
rodney.baker at iinet.net.au
===========================================================
===


More information about the ffmpeg-user mailing list