trying to modify SRS: where is the directory ./objs?

232 Views Asked by At

I am running SRS from a Docker container. On Manjaro I can issue a docker command in terminal, and stream video from OBS to the SRS instance I just launched. I can then view live video in a web page, from that server.

BUT!

The configuration is a bit opaque. The config files refer to a directory ("./objs") that is likely defined in a config file, but I can't find it.

AND!

I'm still a bit confused about how Docker works- isn't there a straightforward way to edit an image or container?

I can see all the config files in /etc/srs (like srs.conf, rtmp.conf and so on). The config files refer to the directory ./objs for the location of (for instance) the nginx root, index.html. But I cannot find that directory.

I also have installed SRS from official repos, on the same machine. I launched srs from /usr/bin/srs (not from the Docker image), but it immediately quits. So I gave up for now. Running it from Docker seems to work pretty well.

1

There are 1 best solutions below

0
On

When start SRS by docker, it actually the same to start in shell:

cd /usr/local/srs && ./objs/srs -c conf/srs.conf

You can also use docker inspect ossrs/srs:5 to get the information:

"Cmd": ["./objs/srs", "-c", "conf/srs.conf"],
"WorkingDir": "/usr/local/srs",
  • The current work directory is /usr/local/srs, so ./objs is /usr/local/srs/objs, and I will describe more about why relative directories.
  • The configuration file is conf/srs.conf, which is actually /usr/local/srs/conf/srs.conf, and there are lots of configuration examples in ./conf.

The examples in ossrs.io is in the same format, uses a configuration and depends on the work directory.

SRS uses relative directory ./objs or ./conf because there are some features depend on it. You can see full.conf for all the configurations that supported.

We use relative directory because you can easily change to other directory, or start more than one SRS server. Of course, you could change the relative directory to abolute directory, please search ./objs in full.conf, for example:

pid ./objs/srs.pid;
ff_log_dir ./objs;
srs_log_file ./objs/srs.log;
http_server {
    dir ./objs/nginx/html;
}
vhost __defaultVhost__ {
    hls {
        hls_path ./objs/nginx/html;
}

Please note that you can use docker volume to mount directory of host for container.