Skip to content

When learning the transcoding function, after changing the acodec from libfdk_aac to aac, multiple instances of FFmpeg are launched, resulting in the inability to generate corresponding transcoded data streams. #2587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MainJackson opened this issue Sep 8, 2021 · 4 comments
Assignees
Labels
Codec HEVC, FFmpeg for ingesting, trascoding or codec. TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Milestone

Comments

@MainJackson
Copy link

MainJackson commented Sep 8, 2021

Description'

Please ensure that the markdown structure is maintained.

  1. SRS version: 4.0
  2. The log of SRS is as follows:
    Please ensure that the markdown structure is maintained.

[2021-09-08 16:57:21.050][Trace][42462][g1706w2p] RTMP listen at tcp://0.0.0.0:1935, fd=7
[2021-09-08 16:57:21.051][Trace][42462][g1706w2p] HTTP-API listen at tcp://0.0.0.0:1985, fd=8
[2021-09-08 16:57:21.051][Trace][42462][g1706w2p] HTTP-Server listen at tcp://0.0.0.0:8080, fd=9
[2021-09-08 16:57:21.051][Trace][42462][g1706w2p] signal installed, reload=1, reopen=30, fast_quit=15, grace_quit=3
[2021-09-08 16:57:21.051][Trace][42462][g1706w2p] http: api mount /console to ./objs/nginx/html/console
[2021-09-08 16:57:21.051][Trace][42462][282bb952] Hybrid cpu=0.00%,0MB
[2021-09-08 16:57:21.051][Warn][42462][5945enl5][2] use public address as ip: 120.203.18.135, ifname=en11
[2021-09-08 16:57:21.051][Trace][42462][5945enl5] Startup query id=c6e7afee108211ecbc663554c881895f, eip=120.203.18.135, wait=551s
[2021-09-08 16:57:21.051][Trace][42462][61k116zp] TCP: connection manager run, conns=0
[2021-09-08 16:57:21.052][Trace][42462][xl6cv38j] RTC: connection manager run, conns=0
[2021-09-08 16:57:26.038][Trace][42462][282bb952] Hybrid cpu=0.00%,0MB
[2021-09-08 16:57:31.038][Trace][42462][282bb952] Hybrid cpu=0.00%,0MB
[2021-09-08 16:57:33.387][Trace][42462][c47g78q2] RTMP client ip=127.0.0.1:64240, fd=11
[2021-09-08 16:57:33.388][Trace][42462][c47g78q2] simple handshake success.
[2021-09-08 16:57:33.388][Trace][42462][c47g78q2] connect app, tcUrl=rtmp://127.0.0.1/live, pageUrl=, swfUrl=rtmp://127.0.0.1/live, schema=rtmp, vhost=127.0.0.1, port=1935, app=live, args=null
[2021-09-08 16:57:33.388][Trace][42462][c47g78q2] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=4096, out.chunk=128
[2021-09-08 16:57:33.389][Trace][42462][c47g78q2] client identified, type=fmle-publish, vhost=127.0.0.1, app=live, stream=test, param=, duration=0ms
[2021-09-08 16:57:33.389][Trace][42462][c47g78q2] connected stream, tcUrl=rtmp://127.0.0.1/live, pageUrl=, swfUrl=rtmp://127.0.0.1/live, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, stream=test, param=, args=null
[2021-09-08 16:57:33.389][Trace][42462][c47g78q2] new source, stream_url=/live/test
[2021-09-08 16:57:33.389][Trace][42462][c47g78q2] source url=/live/test, ip=127.0.0.1, cache=1, is_edge=0, source_id=/
[2021-09-08 16:57:33.390][Trace][42462][c47g78q2] hls: win=60000ms, frag=10000ms, prefix=, path=./objs/nginx/html, m3u8=[app]/[stream].m3u8, ts=[app]/[stream]-[seq].ts, aof=2.00, floor=0, clean=1, waitk=1, dispose=0ms, dts_directly=1
[2021-09-08 16:57:33.390][Trace][42462][c47g78q2] ignore disabled exec for vhost=__defaultVhost__
[2021-09-08 16:57:33.391][Trace][42462][c47g78q2] http: mount flv stream for sid=/live/test, mount=/live/test.flv
[2021-09-08 16:57:33.391][Trace][42462][c47g78q2] start publish mr=0/350, p1stpt=20000, pnt=5000, tcp_nodelay=0
[2021-09-08 16:57:33.392][Trace][42462][c47g78q2] got metadata, width=1120, height=700, vcodec=7, acodec=10
[2021-09-08 16:57:33.400][Trace][42462][c47g78q2] fored process, pid=42467, bin=/usr/local/bin/ffmpeg, stdout=./objs/ffmpeg-encoder-__defaultVhost__-live-test-logo.log, stderr=./objs/ffmpeg-encoder-__defaultVhost__-live-test-logo.log, argv=/usr/local/bin/ffmpeg -f flv -i rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__/test -i ./doc/ffmpeg-logo.png -filter_complex overlay=10:10 -vcodec libx264 -b:v 300000 -r 20.00 -s 768x320 -aspect 768:320 -threads 2 -profile:v baseline -preset superfast -acodec acc -b:a 45000 -ar 44100 -ac 2 -f flv -y rtmp://127.0.0.1:1935/live/test_logo
[2021-09-08 16:57:33.441][Trace][42462][9c4b3fi4] RTMP client ip=127.0.0.1:64241, fd=13
[2021-09-08 16:57:33.443][Trace][42462][9c4b3fi4] complex handshake success
[2021-09-08 16:57:33.443][Trace][42462][9c4b3fi4] connect app, tcUrl=rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, args=null
[2021-09-08 16:57:33.443][Trace][42462][9c4b3fi4] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128
[2021-09-08 16:57:33.444][Trace][42462][9c4b3fi4] ignore AMF0/AMF3 command message.
[2021-09-08 16:57:33.444][Trace][42462][9c4b3fi4] ignore AMF0/AMF3 command message.
[2021-09-08 16:57:33.444][Trace][42462][9c4b3fi4] client identified, type=rtmp-play, vhost=__defaultVhost__, app=live, stream=test, param=, duration=-1ms
[2021-09-08 16:57:33.444][Trace][42462][9c4b3fi4] connected stream, tcUrl=rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, stream=test, param=, args=null
[2021-09-08 16:57:33.444][Trace][42462][9c4b3fi4] source url=/live/test, ip=127.0.0.1, cache=1, is_edge=0, source_id=c47g78q2/c47g78q2
[2021-09-08 16:57:33.445][Trace][42462][9c4b3fi4] dispatch cached gop success. count=0, duration=-1
[2021-09-08 16:57:33.445][Trace][42462][9c4b3fi4] create consumer, active=1, queue_size=0.00, jitter=30000000
[2021-09-08 16:57:33.445][Trace][42462][9c4b3fi4] set fd=13, SO_SNDBUF=146988=>87500, buffer=350ms
[2021-09-08 16:57:33.445][Trace][42462][9c4b3fi4] start play smi=0ms, mw_sleep=350, mw_msgs=8, realtime=0, tcp_nodelay=0
[2021-09-08 16:57:34.381][Trace][42462][c47g78q2] 4B audio sh, codec(10, profile=LC, 2channels, 0kbps, 48000HZ), flv(16bits, 2channels, 44100HZ)
[2021-09-08 16:57:34.382][Trace][42462][c47g78q2] 50B video sh,  codec(7, profile=High, level=3.1, 1120x704, 0kbps, 0.0fps, 0.0s)
[2021-09-08 16:57:35.809][Trace][42462][9c4b3fi4] TCP: before dispose resource(RtmpConn)(0x7ff990c06d60), conns=2, zombies=0, ign=0, inz=0, ind=0
[2021-09-08 16:57:35.809][Warn][42462][9c4b3fi4][4] client disconnect peer. ret=1009
[2021-09-08 16:57:35.809][Trace][42462][61k116zp] TCP: clear zombies=1 resources, conns=2, removing=0, unsubs=0
[2021-09-08 16:57:35.809][Trace][42462][9c4b3fi4] TCP: disposing #0 resource(RtmpConn)(0x7ff990c06d60), conns=2, disposing=1, zombies=0
[2021-09-08 16:57:36.039][Trace][42462][282bb952] Hybrid cpu=0.00%,0MB, cid=4,1, timer=62,0,0, clock=0,35,12,0,0,0,0,0,0, free=1, objs=(pkt:0,raw:0,fua:0,msg:35,oth:0,buf:0)
[2021-09-08 16:57:36.400][Trace][42462][c47g78q2] process pid=42467 terminate, please restart it.
[2021-09-08 16:57:39.411][Trace][42462][c47g78q2] fored process, pid=42468, bin=/usr/local/bin/ffmpeg, stdout=./objs/ffmpeg-encoder-__defaultVhost__-live-test-logo.log, stderr=./objs/ffmpeg-encoder-__defaultVhost__-live-test-logo.log, argv=/usr/local/bin/ffmpeg -f flv -i rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__/test -i ./doc/ffmpeg-logo.png -filter_complex overlay=10:10 -vcodec libx264 -b:v 300000 -r 20.00 -s 768x320 -aspect 768:320 -threads 2 -profile:v baseline -preset superfast -acodec acc -b:a 45000 -ar 44100 -ac 2 -f flv -y rtmp://127.0.0.1:1935/live/test_logo
[2021-09-08 16:57:39.453][Trace][42462][70648451] RTMP client ip=127.0.0.1:64244, fd=13
[2021-09-08 16:57:39.454][Trace][42462][70648451] complex handshake success
[2021-09-08 16:57:39.454][Trace][42462][70648451] connect app, tcUrl=rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, args=null
[2021-09-08 16:57:39.455][Trace][42462][70648451] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128
[2021-09-08 16:57:39.455][Trace][42462][70648451] ignore AMF0/AMF3 command message.
[2021-09-08 16:57:39.455][Trace][42462][70648451] ignore AMF0/AMF3 command message.
[2021-09-08 16:57:39.456][Trace][42462][70648451] client identified, type=rtmp-play, vhost=__defaultVhost__, app=live, stream=test, param=, duration=-1ms
[2021-09-08 16:57:39.456][Trace][42462][70648451] connected stream, tcUrl=rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, stream=test, param=, args=null
[2021-09-08 16:57:39.456][Trace][42462][70648451] source url=/live/test, ip=127.0.0.1, cache=1, is_edge=0, source_id=c47g78q2/c47g78q2
[2021-09-08 16:57:39.456][Trace][42462][70648451] dispatch cached gop success. count=390, duration=5099
[2021-09-08 16:57:39.457][Trace][42462][70648451] create consumer, active=1, queue_size=0.00, jitter=30000000
[2021-09-08 16:57:39.457][Trace][42462][70648451] set fd=13, SO_SNDBUF=146988=>87500, buffer=350ms
[2021-09-08 16:57:39.457][Trace][42462][70648451] start play smi=0ms, mw_sleep=350, mw_msgs=8, realtime=0, tcp_nodelay=0
[2021-09-08 16:57:39.685][Trace][42462][70648451] TCP: before dispose resource(RtmpConn)(0x7ff990c09120), conns=2, zombies=0, ign=0, inz=0, ind=0
[2021-09-08 16:57:39.685][Warn][42462][70648451][4] client disconnect peer. ret=1009
[2021-09-08 16:57:39.685][Trace][42462][61k116zp] TCP: clear zombies=1 resources, conns=2, removing=0, unsubs=0
[2021-09-08 16:57:39.685][Trace][42462][70648451] TCP: disposing #0 resource(RtmpConn)(0x7ff990c09120), conns=2, disposing=1, zombies=0
[2021-09-08 16:57:41.039][Trace][42462][282bb952] Hybrid cpu=0.00%,0MB, cid=4,1, timer=62,0,0, clock=0,35,12,0,0,0,0,0,0, free=1, objs=(pkt:0,raw:0,fua:0,msg:35,oth:0,buf:0)
[2021-09-08 16:57:42.412][Trace][42462][c47g78q2] process pid=42468 terminate, please restart it.
[2021-09-08 16:57:43.389][Trace][42462][c47g78q2] -> HLS time=10007983ms, sno=1, ts=test-0.ts, dur=0.00, dva=9032p
[2021-09-08 16:57:45.422][Trace][42462][c47g78q2] fored process, pid=42469, bin=/usr/local/bin/ffmpeg, stdout=./objs/ffmpeg-encoder-__defaultVhost__-live-test-logo.log, stderr=./objs/ffmpeg-encoder-__defaultVhost__-live-test-logo.log, argv=/usr/local/bin/ffmpeg -f flv -i rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__/test -i ./doc/ffmpeg-logo.png -filter_complex overlay=10:10 -vcodec libx264 -b:v 300000 -r 20.00 -s 768x320 -aspect 768:320 -threads 2 -profile:v baseline -preset superfast -acodec acc -b:a 45000 -ar 44100 -ac 2 -f flv -y rtmp://127.0.0.1:1935/live/test_logo
[2021-09-08 16:57:45.422][Trace][42462][c47g78q2] -> ENC time=12028128, encoders=1, input=__defaultVhost__/live/test
[2021-09-08 16:57:45.450][Trace][42462][5481pj4p] RTMP client ip=127.0.0.1:64247, fd=13
[2021-09-08 16:57:45.451][Trace][42462][5481pj4p] complex handshake success
[2021-09-08 16:57:45.451][Trace][42462][5481pj4p] connect app, tcUrl=rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, args=null
[2021-09-08 16:57:45.451][Trace][42462][5481pj4p] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128
[2021-09-08 16:57:45.452][Trace][42462][5481pj4p] ignore AMF0/AMF3 command message.
[2021-09-08 16:57:45.452][Trace][42462][5481pj4p] ignore AMF0/AMF3 command message.
[2021-09-08 16:57:45.452][Trace][42462][5481pj4p] client identified, type=rtmp-play, vhost=__defaultVhost__, app=live, stream=test, param=, duration=-1ms
[2021-09-08 16:57:45.452][Trace][42462][5481pj4p] connected stream, tcUrl=rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, stream=test, param=, args=null
[2021-09-08 16:57:45.453][Trace][42462][5481pj4p] source url=/live/test, ip=127.0.0.1, cache=1, is_edge=0, source_id=c47g78q2/c47g78q2
[2021-09-08 16:57:45.453][Trace][42462][5481pj4p] dispatch cached gop success. count=214, duration=2777
[2021-09-08 16:57:45.453][Trace][42462][5481pj4p] create consumer, active=1, queue_size=0.00, jitter=30000000
[2021-09-08 16:57:45.453][Trace][42462][5481pj4p] set fd=13, SO_SNDBUF=146988=>87500, buffer=350ms
[2021-09-08 16:57:45.453][Trace][42462][5481pj4p] start play smi=0ms, mw_sleep=350, mw_msgs=8, realtime=0, tcp_nodelay=0
[2021-09-08 16:57:45.802][Warn][42462][5481pj4p][4] drop the received 1 messages
[2021-09-08 16:57:45.803][Trace][42462][5481pj4p] TCP: before dispose resource(RtmpConn)(0x7ff992407b40), conns=2, zombies=0, ign=0, inz=0, ind=0
[2021-09-08 16:57:45.803][Warn][42462][5481pj4p][4] client disconnect peer. ret=1009
[2021-09-08 16:57:45.803][Trace][42462][61k116zp] TCP: clear zombies=1 resources, conns=2, removing=0, unsubs=0
[2021-09-08 16:57:45.803][Trace][42462][5481pj4p] TCP: disposing #0 resource(RtmpConn)(0x7ff992407b40), conns=2, disposing=1, zombies=0
[2021-09-08 16:57:46.039][Trace][42462][282bb952] Hybrid cpu=0.00%,0MB, cid=7,1, timer=62,0,0, clock=0,38,9,0,0,0,0,0,0, free=1, objs=(pkt:0,raw:0,fua:0,msg:297,oth:0,buf:0)
[2021-09-08 16:57:48.422][Trace][42462][c47g78q2] process pid=42469 terminate, please restart it.
  1. The configuration of SRS is as follows:
    Please ensure that the markdown structure is maintained.
listen              1935;
max_connections     1000;
srs_log_tank        file;
srs_log_file        ./objs/srs.log;
daemon              on;
http_api {
    enabled         on;
    listen          1985;
}
http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}
vhost __defaultVhost__ {
    hls {
        enabled         on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
    transcode {
        enabled     on;
        #ffmpeg      ./objs/ffmpeg/bin/ffmpeg;
        ffmpeg      /usr/local/bin/ffmpeg;
        engine logo {
            enabled         on;
            vfilter {
                i               ./doc/ffmpeg-logo.png;
                filter_complex      'overlay=10:10';
            }
            vcodec          libx264;
            vbitrate        300;
            vfps            20;
            vwidth          768;
            vheight         320;
            vthreads        2;
            vprofile        baseline;
            vpreset         superfast;
            vparams {
            }
            acodec          aac;
            abitrate        45;
            asample_rate    44100;
            achannels       2;
            aparams {
            }
            output          rtmp://127.0.0.1:[port]/[app]/[stream]_[engine];
        }
    }
}

Replay
Please ensure that the markdown structure is maintained.

Translation:

  1. Environment: macOS-10.15.7
  2. With the above configuration, start the SRS service: ./objs/srs -c configuration_file_path
  3. Check the ./objs/srs.log log file.
  4. No watermarked data stream is generated.
  5. Changing acodec to libfdk_aac resolves the above issue.

Please make sure to maintain the markdown structure.

Translation:
Expected Behavior (Expect)

Please make sure to maintain the markdown structure.

Translation:
'1. Watermarked stream generation
2. Only one FFmpeg process'

Please make sure to maintain the markdown structure.

TRANS_BY_GPT3

@akanchi
Copy link
Contributor

akanchi commented Sep 8, 2021

You can take a look at the information output in the log ./objs/ffmpeg-encoder-__defaultVhost__-live-test-logo.log. It might be that your local /usr/local/bin/ffmpeg cannot recognize the encoder named aac.

TRANS_BY_GPT3

@MainJackson
Copy link
Author

MainJackson commented Sep 8, 2021

I extracted the ffmpeg from the log and tried it: /usr/local/bin/ffmpeg -f flv -i rtmp://127.0.0.1:1935/live?vhost=defaultVhost/test -i ./doc/ffmpeg-logo.png -filter_complex overlay=10:10 -vcodec libx264 -b:v 300000 -r 20.00 -s 768x320 -aspect 768:320 -threads 2 -profile:v baseline -preset superfast -acodec acc -b:a 45000 -ar 44100 -ac 2 -f flv -y rtmp://127.0.0.1:1935/live/test_logo, and it can push the stream normally.

TRANS_BY_GPT3

@Cyaim
Copy link

Cyaim commented Sep 9, 2021

There is indeed this problem, the AAC encoder is just not good.

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Sep 10, 2021
@winlinvip winlinvip added Codec HEVC, FFmpeg for ingesting, trascoding or codec. Won't fix We won't fix it. labels Sep 10, 2021
@winlinvip
Copy link
Member

@akanchi 👍

@winlinvip winlinvip added this to the 3.0 milestone Sep 10, 2021
@winlinvip winlinvip changed the title 学习转码功能时把acodec由libfdk_aac换成aac后,FFmpeg被多个拉起,导致无法生成对应转码数据流 When learning the transcoding function, after changing the acodec from libfdk_aac to aac, multiple instances of FFmpeg are launched, resulting in the inability to generate corresponding transcoded data streams. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codec HEVC, FFmpeg for ingesting, trascoding or codec. TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Projects
None yet
Development

No branches or pull requests

4 participants