Skip to content
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

Get path or name from the mp4 generated after stream #653

Open
DarckBlezzer opened this issue Aug 14, 2024 · 0 comments
Open

Get path or name from the mp4 generated after stream #653

DarckBlezzer opened this issue Aug 14, 2024 · 0 comments

Comments

@DarckBlezzer
Copy link

I would like to do some things with the mp4 generated file, but can't find the way to get the file generated...

const NodeMediaServer = require("./node-media-server");
const config = {
  rtmp: {
    port: 1935,
    chunk_size: 60000,
    gop_cache: true,
    ping: 30,
    ping_timeout: 60,
  },
  http: {
    port: 8083,
    mediaroot: "./media",
    allow_origin: "*",
  },
  trans: {
    ffmpeg: "/usr/bin/ffmpeg",
    tasks: [
      {
        app: "live",
        hls: true,
        // hlsFlags: "[hls_time=2:hls_list_size=3:hls_flags=delete_segments]",
        hlsFlags: "[hls_time=10:hls_list_size=0:hls_flags=delete_segments]",
        hlsKeep: false,
        mp4: true,
        mp4Flags: "[movflags=frag_keyframe+empty_moov]",
      },
      {
        app: "live0",
        hls: true,
        // hlsFlags: "[hls_time=2:hls_list_size=3:hls_flags=delete_segments]",
        hlsFlags: "[hls_time=10:hls_list_size=0:hls_flags=delete_segments]",
        hlsKeep: false,
        mp4: true,
        mp4Flags: "[movflags=frag_keyframe+empty_moov]",
      },
      {
        app: "live1",
        hls: true,
        // hlsFlags: "[hls_time=2:hls_list_size=3:hls_flags=delete_segments]",
        hlsFlags: "[hls_time=10:hls_list_size=0:hls_flags=delete_segments]",
        hlsKeep: false,
        mp4: true,
        mp4Flags: "[movflags=frag_keyframe+empty_moov]",
      },
    ],
  },
};
var nms = new NodeMediaServer(config);
nms.run();

// Where could I get the generated video path/name etc?
nms.on("doneConnect", (id, args) => {
  console.log(
    "[NodeEvent on doneConnect]",
    `id=${id} args=${JSON.stringify(args)}`
  );
  
  
  // let session = nms.getSession(id);
  // session.reject();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant