Я должен запустить команду ffmpeg. Я запускаю приведенную ниже команду в командной строке и работает нормально.

 ffmpeg -v verbose -i rtsp://99.192.203.99:8091/test.sdp -i rtsp://99.192.203.99:8091/test.sdp -vcodec copy -acodec copy -flags -global_header -hls_time 10 -hls_list_size 30  -start_number 1 http://server.com:8080/ingest/live/11/index1.m3u8 -vcodec copy -acodec copy -flags -global_header -hls_time 10 -hls_list_size 30  -start_number 1 http://server.com:8080/ingest/live/11/index2.m3u8

Но если поместить команду в сценарий оболочки, то она не работает.Ниже приведен полный сценарий.

#!/bin/bash

  export PATH=$PATH:/root/prashanta/timeShift:/root/bin

hlsListSize=30
rtspURL="rtsp://95.192.213.99:8091/test.sdp"
oscURL="http://10.102.10.188:8080/ingest/live/"
chNo=$1
ingestURL=$oscURL$chNo

/root/bin/ffmpeg -v verbose -i $rtspURL -i $rtspURL -vcodec copy -acodec copy -flags -global_header -hls_time 10 -hls_list_size $hlsListSize  -start_number 1 $ingestURL/index1.m3u8 -vcodec copy -acodec copy -flags -global_header -hls_time 10 -hls_list_size $hlsListSize  -start_number 1 $ingestURL/index2.m3u8

Это говорит (несколько строк из положенного):

    a=rtpmap:97 mpeg4-generic/44100/2
a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1210; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
a=control:rtsp://99.192.203.99:8091/test.sdp/trackID=1

[h264 @ 0x3972160] Current profile doesn't provide more RBSP data in PPS, skipping
Input #1, rtsp, from 'rtsp://99.192.203.99:8091/test.sdp':
  Metadata:
    title           : Unnamed
    comment         : N/A
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: h264 (Constrained Baseline), yuv420p, 480x272 [SAR 1:1 DAR 30:17], 24 fps, 24 tbr, 90k tbn, 48 tbc
    Stream #1:1: Audio: aac (LC), 44100 Hz, stereo, fltp
Output #0, hls, to 'http://10.102.10.188:8080/mmingest/live/16/index1.m3u8':
  Metadata:
    title           : Unnamed
    comment         : N/A
    encoder         : Lavf56.19.101
    Stream #0:0: Video: h264, yuv420p, 480x272 (0x0) [SAR 1:1 DAR 30:17], q=2-31, 24 fps, 24 tbr, 24 tbn, 24 tbc
    Stream #0:1: Audio: aac, 44100 Hz, stereo
Output #1, hls, to 'http://10.102.10.188:8080/mmingest/live/16/index2.m3u8':
  Metadata:
    title           : Unnamed
    comment         : N/A
    Stream #1:0: Video: h264, yuv420p, 480x272 (0x0) [SAR 1:1 DAR 30:17], q=2-31, 24 fps, 24 tbr, 24 tbn, 24 tbc
    Stream #1:1: Audio: aac, 44100 Hz, stereo
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:0 -> #1:0 (copy)
  Stream #0:1 -> #1:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Connection timed out

0