У меня есть Ubuntu 12.04 LTS, на котором работает Wowza Media Server, поэтому я использую FFmpeg в качестве транскодера для прямой трансляции и JWplayer на своем веб-сайте. Но ffmpeg всегда останавливает конвертацию, и мне приходится вводить команду снова и снова. Итак, вот команда:
nohup ffmpeg -i rtsp://log:pass@<cameraip>:554/live1.sdp -ar 44100 -ab 128k -f flv -b 5000k -s 480x270 -y rtmp://<serverip>:1935/live/camera.stream &
И вот что я получаю
ffmpeg version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
built on Feb 6 2014 20:56:59 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[rtsp @ 0x25317a0] Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 150.00 (150/1) -> 1000.00 (1000/1)
Input #0, rtsp, from 'rtsp://log:pass@<cameraip>:554/live1.sdp':
Metadata:
title : RTSP/RTP stream 1 from DCS-2132L
comment : live1.sdp with v2.0
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264 (High), yuvj420p, 640x360 [PAR 1:1 DAR 16:9], 75 fps, 1k tbr, 90k tbn, 150 tbc
Stream #0.1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
Incompatible pixel format 'yuvj420p' for codec 'mpeg4', auto-selecting format 'yuv420p'
[buffer @ 0x2539f80] w:640 h:360 pixfmt:yuvj420p
[scale @ 0x253a940] w:640 h:360 fmt:yuvj420p -> w:480 h:270 fmt:yuv420p flags:0x4
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[ac3 @ 0x2531120] channel_layout not specified
[ac3 @ 0x2531120] No channel layout specified. The encoder will guess the layout, but it might be incorrect.
[ac3 @ 0x2531120] invalid bit rate
Output #0, avi, to 'rtmp://<serverip>:1935/live/camera.stream':
Stream #0.0: Video: mpeg4, yuv420p, 480x270 [PAR 1:1 DAR 16:9], q=2-31, 1024 kb/s, 90k tbn, 1k tbc
Stream #0.1: Audio: ac3, 22050 Hz, mono, flt, 1024 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height