[FFmpeg-user] Problem with ffmpeg command when recording live streams

DopeLabs dopelabs at dubstep.fm
Fri Apr 28 17:55:48 EEST 2017


Have you tried a stream copy or only encoding the audio to mp3/aac since the video looks like its already in h264?

Stream copy video and re-encode audio

ffmpeg -I rtsp:/ip -c:v copy -c:a mp3 -b:a 128k -movflags +faststart -f mp4 outfile.mp4



> On Apr 28, 2017, at 6:12 24AM, Yanet Giuse <yanetagiu-at-yahoo.com at ffmpeg.org> wrote:
> 
> Hello!I am trying to record a live rtsp stream and save videos locally using ffmpeg, but i cant.This stream is a camera, and Ive tested the video stream in VLC. It works.
> First, the ffplay command (ffplay rtsp://ip ) returns
> [rtsp @ 0x7fa574009280] UDP timeout, retrying with TCP   0B f=0/0   
> [rtsp @ 0x7fa574009280] method PAUSE failed: 455 Method Not Valid in This State
> [rtsp @ 0x7fa574009280] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
> Consider increasing the value for the 'analyzeduration' and 'probesize' options
> Input #0, rtsp, from 'rtsp://ip':
>   Metadata:
>     title           : Media Server
>   Duration: N/A, bitrate: 128 kb/s
>     Stream #0:0: Video: h264, none, 90k tbr, 90k tbn, 180k tbc
>     Stream #0:1: Audio: pcm_alaw, 16000 Hz, 1 channels, s16, 128 kb/s
> [rtsp @ 0x7fa574009280] UDP timeout, retrying with TCP   0B f=0/0   
> [rtsp @ 0x7fa574009280] method PAUSE failed: 455 Method Not Valid in This State
> So, i installed h264 and h265 codecs and re-installed ffmpeg. But the same error happened.Alsp, i tried the ffmpeg command
> ffmpeg -i rtsp://ip -r 15 outvideo.mp4
> the result is:
> [rtsp @ 0x11e30c0] UDP timeout, retrying with TCP
> [rtsp @ 0x11e30c0] method PAUSE failed: 455 Method Not Valid in This State
> [rtsp @ 0x11e30c0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
> Consider increasing the value for the 'analyzeduration' and 'probesize' options
> Guessed Channel Layout for Input Stream #0.1 : mono
> Input #0, rtsp, from 'rtsp://ip':
>   Metadata:
>     title           : Media Server
>   Duration: N/A, bitrate: 128 kb/s
>     Stream #0:0: Video: h264, none, 90k tbr, 90k tbn, 180k tbc
>     Stream #0:1: Audio: pcm_alaw, 16000 Hz, 1 channels, s16, 128 kb/s
> [mp4 @ 0x1237260] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
> Output #0, mp4, to 'outvideo.mp4':
>   Metadata:
>     title           : Media Server
>     encoder         : Lavf57.50.100
>     Stream #0:0: Audio: aac (LC) ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 69 kb/s
>     Metadata:
>       encoder         : Lavc57.57.101 aac
> Stream mapping:
>   Stream #0:1 -> #0:0 (pcm_alaw (native) -> aac (native))
> Press [q] to stop, [?] for help
> [rtsp @ 0x11e30c0] UDP timeout, retrying with TCP
> [rtsp @ 0x11e30c0] method PAUSE failed: 455 Method Not Valid in This State
> rtsp://ip: Operation not permitted
> size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
> video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
> [aac @ 0x1238a60] Qavg: -nan
> 
> I tried with several parameters I found on the web. No chances to work.
> 
> I think it is a codec problem, or maybe the reason is that my camera is in 192.168.32. and my computer works in 192.168.31.I am searching for suggests, reasons, commands .. Everything that helps..
> 
> 
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list