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

parameters #30

Open
sandorkrisz opened this issue Mar 4, 2020 · 0 comments
Open

parameters #30

sandorkrisz opened this issue Mar 4, 2020 · 0 comments

Comments

@sandorkrisz
Copy link

I have suggest to you change this code in index.js

var params = [];
params.push('-show_streams', '-print_format', 'json', filePath);

var d = Deferred();
var info;
var stderr;

var ffprobe = spawn(opts.path, params);

to this, for ability to send parameters for ffprobe:

if( typeof opts.params == "undefined" )
opts.params = [ '-show_streams' ];
opts.params.push( '-print_format', 'json', filePath );

var d = Deferred();
var info;
var stderr;
var ffprobe = spawn(opts.path, opts.params);

The example of parametering for gain frames time informations:

var ffprobe = require('ffprobe'),
ffprobeStatic = require('ffprobe-static');
ffprobe('./file.mp4',
{ path: ffprobeStatic.path,
params: ["-select_streams", "v","-show_frames"]
},
function (err, info) {
if (err) return done(err);
console.log(info);
/*

    {
    media_type: 'video',
    stream_index: 0,
    key_frame: 0,
    pkt_pts: 50688,
    pkt_pts_time: '3.960000',
    pkt_dts: 50688,
    pkt_dts_time: '3.960000',
    best_effort_timestamp: 50688,
    best_effort_timestamp_time: '3.960000',
    pkt_duration: 512,
    pkt_duration_time: '0.040000',
    pkt_pos: '657372',
    pkt_size: '310',
    width: 1024,
    height: 576,
    pix_fmt: 'yuv420p',
    sample_aspect_ratio: '18961:18969',
    pict_type: 'B',
    coded_picture_number: 100,
    display_picture_number: 0,
    interlaced_frame: 0,
    top_field_first: 0,
    repeat_pict: 0,
    chroma_location: 'left'
    },
    */

}
);
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