Posts

FFMPEG: extract images from video with fixed interval, first few frames messed up -

i wanted extract frames video fixed interval, used command lines like: ffmpeg.exe -i input.mp4 -r 5 results\%d.jpg` however, interval between first few frames different of rest. for example, if both ffmpeg.exe -i input.mp4 -r 25 -t 5 test\%d.jpg , ffmpeg.exe -i input.mp4 -r 5 -t 5 test2\%d.jpg (for fps 25 video), expect results in test2 subsequence of results in test interval 5. got are: screenshot of results from thumbnails, obvious images 112~125 in test not appear in test2 . close inspection reveals correspondence between 2 set of results follows: test | test2 1&2 | 1&2 (those 2 frames identical) 3 | 3 4 | 4 9 | 5 14 | 6 19 | 7 ... | ... 104 | 24 109 | 25 (actually, when comparing last frames, realized results in test had mosaic. fixed adding option -q:v 1 .) as can seen, first few frames test2 have interval 1, instead of expected value 5. what reason behavior, , how fix it? in case want see ffmpeg output...

jquery - Custom render returning binary data to ajax call in django-rest framework -

i making ajax call rest api , expect raw binary data. $.ajax({ url: 'verify', type: 'post', contenttype: "application/json; charset=utf-8", data: json.stringify({ "url": url, }), datatype: "application/octet-stream", success: function(response, textstatus, jqxhr) { if (response) { try { // } catch (e) { displayerror(e); } } }, error: function(jqxhr, textstatus, errorthrown) { // loader.remove(); // $.unblockui(); console.log(textstatus); // parsererror console.log(errorthrown); // no conversion text application/octet-stream var err = parseerror(jqxhr, textstatus, errorthrown); ...

javascript - How to iterate and parse JSON from query in Express/Jade? -

i new nodejs i'm thinking simple cannot find way pass json data select query jade view. using node.js tools visual studio create project uses express + jade. here index.js file: exports.products = function (req, res) { var request = new sql.request(connection); console.log("connection successful."); request.query('select * product', function (err, data) { console.log(data[i]); res.render('products', { title: 'products', year: new date().getfullyear(), message: 'products page devices', name: 'rodney', result: data[i] }); }); this view i'm using in jade render results: - product = typeof(result) != 'undefined' ? result : { } p in product h3 #{product.name} i getting error i not defined makes sense, can show 1 record if change result: data[0] . here sample of how json structured: { id: 56, name: 'motion', modelstring: '1234-g', d...

dictionary - Can I have a javascript object remove itself from memory by having it set its map value to null? -

would game object remove memory when kill game called? var gamesmap = {}; var count = 0; function game (players, privategame) { if (privategame) this.privategame = true; else this.privategame = false; this._id = count++; this.players = players; this.judge = this.setjudge(); this.killgame() = function() { gamesmap[this._id] = null; } } if there no other references particular game object (including event handlers , other lasting things that), clearing last reference clearing reference in gamesmap make eligible garbage collection when killgame() method finishes executing. but, fact able call obj.killgame() means else has reference reference needs released too. i suggest rather set property null delete property in map this: delete gamesmap[this._id]; so you're cleaning after game done.

rotational matrix in R -

Image
i want achieve algorithm in r. cannot start code because having proble figuring out problem clearly. problem related rotational matrix, actully pretty challenging. the problem follow: the historical data of monthly flows x transformed y transformation matrix r where, y = rx (3) procedure obtaining transformation matrix described in detail in appendix of tarboton et al. (1998), here summarize description. transformation matrix developed standard basis (basis vectors aligned coordinate axes) orthonormal not have basis vector perpendicular conditioning plane defined (3). 1 of standard basis vectors replaced vector perpendicular conditioning plane. operationally amounts starting identity matrix , replacing last column . basis set in no longer orthonormal. gram schmidt orthonormalization procedure applied remaining 1 standard basis vectors obtain orthonormal basis includes vector perpendicular conditioning plane. last column of matrix y, , , r matri...

javascript - SmoothState onAfter callback -

i have site has elements slider on pages. trying implement smoothstate js running issue of second page breaking. know through documentation need add onafter callback wondering , how applied. apparently can tricky if unfamiliar ajax. here documentation on issue. and code have fires script: $(function(){ 'use strict'; var $page = $('#uber'), options = { debug: true, prefetch: true, cachelength: 2, onstart: { duration: 250, // duration of our animation render: function ($container) { // add css animation reversing class $container.addclass('is-exiting'); // restart animation smoothstate.restartcssanimations(); } }, onready: { duration: 0, render: function ($container, $newcontent) { // remove css animation reversing class $container.removeclass('is-exiting'); ...

java - trouble passing input from one JTextArea into another JTextArea -

my issue lies in documentlister arealistener. can't seem figure out how pass in text user enters 1 of jtextareas conversions , return other jtextarea. the goal of program take in user entered roman or arabic number in 1 of fields, convert , return value of conversion other field in real time. my gui , conversion methods work, can't seem wrap head around obtaining string user , printing in real time. public class arabictoromangui_hard extends jframe { private static final long serialversionuid = 1l; jpanel panel = new jpanel(); //constructor add text fields frame public arabictoromangui_hard() { jtextarea left = new jtextarea(10, 20); jtextarea right = new jtextarea(10, 20); setlayout(new gridlayout(1, 2)); add(new jscrollpane(left)); add(new jscrollpane(right)); mirrordocument leftdoc = new mirrordocument(); mirrordocument rightdoc = new mirrordocument(); left.setdocument(leftdoc); right.setdocument(rightdoc); leftdoc....