Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

concat & mutli-output #30

Closed
scottf-tvw opened this issue Jul 22, 2014 · 4 comments
Closed

concat & mutli-output #30

scottf-tvw opened this issue Jul 22, 2014 · 4 comments

Comments

@scottf-tvw
Copy link
Contributor

I want to be able to use the concat feature of ffmpeg with the transcoder using a txt list of files. is there any way to simply override the -i and in the transcoder? I am pretty new to this projects code and I am sure I can figure out how to override by catching an input file name of concat and removing the -i. I just need a little guidance to know where things are happening in the code..
https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files

Another feature that would be nice it to be able to leverage the capability of ffmpeg to generate multiple outputs from a singe input.
https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs

@scottf-tvw
Copy link
Contributor Author

So I made the changes to job.js for those who want to know how to do concat.
prepare:

if (job.parsedOpts()['source_file'] == 'concat'){
          callback("hasInput");
      }else{
          fs.stat(job.parsedOpts()['source_file'], function(err, stats) {
              if (err) {
                  job.exitHandler(-1, "unable to read input file (" + job.parsedOpts()['source_file'] + ").");
              } else {
                  if (stats.isFile()) { job.filesize = stats.size || Number.NaN };
                  callback("hasInput");
              }
          });

and spawn:

if (job.parsedOpts()['source_file'] != 'concat'){
            args.push('-i', this.parsedOpts()['source_file']);
          }

send the string "concat" as the input file, then in your "encoder_options" format your options as specified in the ffmpeg documentation for concat.
simple usage: -f concat -i yourfileslist.txt -c copy

@tieleman
Copy link
Contributor

Hi Scott, glad you got it working with the concat filter. I'm going to refer to what I just wrote at #31 as well (check it out if you will): Codem was initially built with the one file in, one file out philosophy. That doesn't seem always viable anymore, so we are considering other options, but we don't have any short-term plans to implement these features. We need to rewrite a considerable amount of code to support these features properly.

@scottf-tvw
Copy link
Contributor Author

Thanks for responding, after looking at your code I would agree that in conjunction with the scheduler it would indeed take a lot of code refactoring. The standard tee is a much different animal than the HLS outputs mentioned in issue #31. Since the transcoder js code alone could be easily refactored to allow for multiple predictable outputs by simply implementing an output array+loop in a few places, I am going to work on it a little bit. The scheduler however... ruby is new to me. like since last week.. To get around it I will implement a similar 'hack' if you will, in the filters or directly with json for the output in the jobs table until my project settles down and I will start to learn ruby properly. Nice work btw. even with the tweaks, this project is saving me from re-inventing the wheel.

@jbankston
Copy link

I agree. We were going to build out an internal solution from scratch. This
is great work.

Julian Bankston
(615) 669-3057
Founder
Britevid
Mave Media LLC

On Thu, Jul 24, 2014 at 9:34 AM, Scott Freeman notifications@github.com
wrote:

Thanks for responding, after looking at your code I would agree that in
conjunction with the scheduler it would indeed take a lot of code
refactoring. The standard tee is a much different animal than the HLS
outputs mentioned in issue #31
#31. Since the
transcoder js code alone could be easily refactored to allow for multiple
predictable outputs by simply implementing an output array+loop in a few
places, I am going to work on it a little bit. The scheduler however...
ruby is new to me. like since last week.. To get around it I will implement
a similar 'hack' if you will, in the filters or directly with json for the
output in the jobs table until my project settles down and I will start to
learn ruby properly. Nice work btw. even with the tweaks, this project is
saving me from re-inventing the wheel.


Reply to this email directly or view it on GitHub
#30 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants