I always got the following error, when trying to connect ffmpeg with ffserver:
But let's start with the theory:
I want to Broadcast a stream, which is already existing in the internet (to able to do some analytic stuff on the stream).
So my idea is as follows:
i have one ubuntu-server (currently ubuntu-desktop version 12.x on a virtual machine, i will change it to a real server later...).
and i want to run on the server:
ffmpeg, which should record the live-stream (and saves it locally)
ffserver, for broadcasting the same live-stream, using the rtp protocoll (because of the timestamp-header in the protocoll).
so if i understoot the documentation correctly, this is my idea:
start ffserver from linux-terminal
ffserver -f ~/Desktop/ffserver.conf
start ffmpeg and connect to the feed of ffserver
ffmpeg -re -i "http://InternetStreamer.sdp/playlist.m3u8" -vcodec libx264 -s 320x240 -pix_fmt yuv420p -vb 200000 -minrate 200000 -maxrate 200000 -bufsize 2000000 -acodec libmp3lame -ab 128k -ar 44100 -f rtp -an http://localhost:8090/feed1.ffm
(I am getting the Stream from the URL "http://InternetStreamer.sdp/playlist.m3u8" and want sent it to ffserver(also i want to save it locally for backup later...))
now when i start ffmpeg i get the following error:
Could not write header for output file #0 (incorrect codec parameters?)
Last thing to say is that is very important to broadcast the stream with RTP-Protocoll. (Best case would be directly from ffmpeg, because then the RTP-headers are as set as early as possible)
my server.conf looks like follows:
Port 8090 BindAddress 0.0.0.0 MaxHTTPConnections 2000 MaxClients 1000 MaxBandwidth 1000 CustomLog - NoDaemon <Feed feed1.ffm> #file ffmpeg http://localhost:8090/feed1.ffm #Format rtp #File /tmp/feed1.ffm #FileMaxSize 200K File /tmp/cam1.ffm ACL allow 127.0.0.1 #VideoFrameRate 25 </Feed> <Stream test1.rtp> Feed feed1.ffm Format rtp #VideoFrameRate 25 #Hier: alle parameter von ffmpeg angeben! #-re -i "http://apasfiisl.apa.at/ipad/orf2_q4a/orf.sdp/playlist.m3u8" #-vcodec libx264 #-s 320x240 #-pix_fmt yuv420p #-vb 200000 #-minrate 200000 #-maxrate 200000 #-bufsize 2000000 #-acodec libmp3lame #-ab 128k #-ar 44100 #AudioBitRate 32 #AudioChannels 1 #AudioSampleRate 44100 #VideoBitRate 64 #VideoBufferSize 40 VideoFrameRate 3 #VideoSize 160x128 #VideoGopSize 12 </Stream> ################################################################## # Special streams # Server status <Stream stat.html> Format status # Only allow local people to get the status ACL allow localhost ACL allow 192.168.0.0 192.168.255.255 #FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico </Stream> # Redirect index.html to the appropriate sites <Redirect index.html> URL http://www.ffmpeg.org/ </Redirect> #################################################################### This is the full console output from ffmpeg: #################################################################### The ffmpeg program is only provided for script compatibility and will be removed in a future release. It has been deprecated in the Libav project to allow for incompatible command line syntax improvements in its replacement called avconv (see Changelog for details). Please use avconv instead. [applehttp @ 0x91fa240] max_analyze_duration reached [applehttp @ 0x91fa240] Estimating duration from bitrate, this may be inaccurate Seems stream 1 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 25.00 (25/1) Input #0, applehttp, from 'http://InternetStreamer.sdp/playlist.m3u8': Duration: N/A, start: 61442.038956, bitrate: N/A Stream #0.0: Data: [21][0][0][0] / 0x0015 Metadata: variant_bitrate : 831114 Stream #0.1: Video: h264 (Main), yuvj420p, 640x360 [PAR 1:1 DAR 16:9], 25 tbr, 90k tbn, 180k tbc Metadata: variant_bitrate : 831114 Stream #0.2: Audio: aac, 44100 Hz, stereo, s16 Metadata: variant_bitrate : 831114 [buffer @ 0x9215720] w:640 h:360 pixfmt:yuvj420p [scale @ 0x9434300] w:640 h:360 fmt:yuvj420p -> w:320 h:240 fmt:yuv420p flags:0x4 [libx264 @ 0x923a560] using SAR=4/3 [libx264 @ 0x923a560] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 [libx264 @ 0x923a560] profile Main, level 1.3 Output #0, rtp, to 'http://localhost:8090/feed1.ffm': Metadata: encoder : Lavf53.21.1 Stream #0.0: Video: libx264, yuv420p, 320x240 [PAR 4:3 DAR 16:9], q=-1--1, 200 kb/s, 90k tbn, 25 tbc Metadata: variant_bitrate : 831114 Stream mapping: Stream #0.1 -> #0.0 Could not write header for output file #0 (incorrect codec parameters ?)
Kind Regards
Thomas
Bearbeitet von XM-Franz:
Codeblöcke, Zeilenumbrüche, Listen- und Linksyntax eingefügt, um den Beitrag lesbar zu gestalten. Bitte nutze die Hilfe zur Syntax und die Vorschau.
Moderiert von XM-Franz:
Du hast Dich gestern im deutschsprachigem Forum http://forum.ubuntuusers.de/ registriert und Du hast dabei bestätigt: "Durch das Abschließen der Registrierung stimme ich den Nutzungsbedingungen und Forenregeln ebenfalls zu." Halte Dich bitte an Forenregel 1 "Deutsche Rechtschreibung"