How to split accurately a LONG GOP video (h264/XDCAM...) with FFMPEG? |
Please refer to the ffmpeg documentation.
You will find an option -frames. That option can be use to specify for a
given input stream (in the following the stream 0:0 is the 1st input file,
first video stream) the number of frame to record. That option can be
combined with other options to start somewhere in the input file (time
offset, etc ....)
ffmpeg -i intput.ts -frames:0:0 100 -vcodec copy test.ts
that command demux and remux only the first 100 frame of the video (no
re-encoding).
as said you can combine it with a jump. Using ' ‘-ss offset (input)’
' you can specify a "Frame Accurate" position ie. frame 14 after
1min10seconds = 0:1:10:14. that option should be use before the input like
below.
ffmpeg -ss 00:00:10.0 -i intput.ts -frames:0:0 100 -vcodec copy test.ts
ffmpeg dis
|
Playing videos on iPhone after video conversion using ffmpeg |
I just wrote a blog post that covers encoding_h264_for_ios that shows
examples of h.264 encoding that do and do not work on iOS hardware. The
specific command line that I use is this:
ffmpeg -y -i INPUT.mov -c:v libx264
-pix_fmt yuv420p -preset:v slow
-profile:v baseline -crf 23
OUTPUT.m4v
If I were you, I would try to encode the videos on the command line and
test them on iOS hardware without the web interface. Then, go step by step
with specific command line options until you found the one that was
breaking the iOS playback.
|
Cutting the videos based on start and end time using ffmpeg |
You probably do not have a keyframe at the 3 second mark. Because
non-keyframes encode differences from other frames, they require all of the
data starting with the previous keyframe.
With the mp4 container it is possible to cut at a non-keyframe without
re-encoding using an edit list. In other words, if the closest keyframe
before 3s is at 0s then it will copy the video starting at 0s and use an
edit list to tell the player to start playing 3 seconds in.
If you are using the latest ffmpeg from git master it will do this using an
edit list when invoked using the command that you provided. If this is not
working for you then you are probably either using an older version of
ffmpeg, or your player does not support edit lists. Some players will
ignore the edit list and always play all o
|
ffmpeg commands to concatenate different type and resolution videos into 1 video and can be played in android |
You can use concat to append all the videos one by one after converting
them to a single format.
You can also use the below command to convert differently formatted video
to one format:
./ffmpeg -i 1.mp4 -acodec libvo_aacenc -vcodec libx264 -s 1920x1080 -r 60
-strict experimental 1.mp4
Convert everything to mp4 and then follow the instructions given in the
link above. This will enable you to join all the videos in a single file.
|
Android FFMPEG: Could not execute the ffmpeg from Java code |
Do you have root on the device?
Mount '/data' and then enter your same 'ffmpeg' command in the shell and
see whether the error is the same.
Try using the shell to test out different command expressions.
Try 'ffmpeg' alone and with just one input file. See whether those commands
produce expected output.
My wild guess would be that there is an issue with calling 'ffmpeg.main()'
that relates to the details of your build.
|
OpenCV won't open some videos of many videos of the same format |
I understand that this is a crash? If so, the answer is pretty simple:
there's a bug in codec, from the name of the DLL I think that's ffmpeg H264
codec. You should try to update it, or just avoid it.
|
R: Split-Apply-Combine... Apply Functions via Aggregate to Row-Bound Data Frames Subset by Class |
You've tackled this problem in a way that makes it very hard to debug. I'd
recommend switching things around so you can more easily check each step.
(Using informative variable names also helps!) The code is unlikely to work
as is, but it should be much easier to work iteratively, checking that each
step has succeeded before continuing to the next.
paths <- dir("C:/Data/", pattern = "\.csv$")
# Read in CSV files as data frames
raw <- lapply(paths, read.csv, str)
# Extract needed rows
filter_metrics <- c("MaxTemp", "AvgTemp", "MinTemp")
filter_years <- 1970:2000
filtered <- lapply(raw, subset,
!is.na(Value) & Year %in% filter_years & Element %in%
filter_metrics)
# Drop any empty data frames
rows <- vapply(filtered, nrow, integer(1))
filtered <- filtered[r
|
MediaPlayer onCompletion is not being called accurately |
You're using the correct Method but have you passed any code in the
"// do some tasks here when playback completes " AREA.
If not then the callback wont make any sense.
mMediaPlayer.setOnCompletionListener(new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
Toast.makeText(getApplicationContext(),"Playback Completes",
Toast.LENGTH_SHORT).show();
}
});
This method will pop a Toast on completion of playback.
|
why this sql query does not pass result accurately? |
Not 100% sure about all your query but sounds like you might need to UNION
the two sub-queries into one, then you can sum in the SELECT clause...
SELECT sum(T) AS d,
Y.ApplicantId,
Y.Applicantname
FROM (
SELECT tblexperience.ApplicantId,
SUM(tblExpeRange.score)as T
FROM tblexperience
LEFT OUTER JOIN tblExpeRange
ON tblexperience.ExpRange=tblExpeRange.expeRange
GROUP BY tblexperience.ApplicantId
UNION
SELECT tblAcademicInfo.ApplicantId,
SUM(tblGradPoint.score) AS T
FROM tblAcademicInfo
LEFT OUTER JOIN tblGradPoint
ON tblAcademicInfo.cgpa=tblGradPoint.[cgpa/division]
GROUP BY tblAcademicInfo.ApplicantId
|
How to convert nvarchar to varbinary accurately |
It seems that your password field isn't actually a varbinary, despite
looking like one.
Run these for an example:
SELECT
CAST('0x3E6AFF88BEB29D9B234B9E5A5AD329D8D3F33200EC4EE02749C56AD58D040976'
AS varbinary(max))
SELECT
CAST(CAST('0x3E6AFF88BEB29D9B234B9E5A5AD329D8D3F33200EC4EE02749C56AD58D040976'
AS varbinary(max))AS VARCHAR(MAX))
SELECT CAST('dog' AS VARBINARY(MAX))
SELECT CAST(CAST('dog' AS VARBINARY(max))AS VARCHAR(MAX))
You see that your result is the equivalent of your initial string, just in
varbinary format.
|
How to get database size accurately in postgresql? |
Your options include:
1). Ensuring autovacuum is enabled and set aggressively.
2). Recreating the table as I mentioned in an earlier comment
(create-table-as-select + truncate + reload the original table).
3). Running CLUSTER on the table if you can afford to be locked out of that
table (exclusive lock).
4). VACUUM FULL, though CLUSTER is more efficient and recommended.
5). Running a plain VACUUM ANALYZE a few times and leaving the table as-is,
to eventually fill the space back up as new data comes in.
6). Dump and reload the table via pg_dump
7). pg_repack (though I haven't used it in production)
|
Javascript convert HSB/HSV color to RGB accurately |
From Parthik Gosar's link in this comment with slight modification to let
you enter each value independently or all at once as an object
/* accepts parameters
* h Object = {h:x, s:y, v:z}
* OR
* h, s, v
*/
function HSVtoRGB(h, s, v) {
var r, g, b, i, f, p, q, t;
if (arguments.length === 1) {
s = h.s, v = h.v, h = h.h;
}
i = Math.floor(h * 6);
f = h * 6 - i;
p = v * (1 - s);
q = v * (1 - f * s);
t = v * (1 - (1 - f) * s);
switch (i % 6) {
case 0: r = v, g = t, b = p; break;
case 1: r = q, g = v, b = p; break;
case 2: r = p, g = v, b = t; break;
case 3: r = p, g = q, b = v; break;
case 4: r = t, g = p, b = v; break;
case 5: r = v, g = p, b = q; break;
}
return {
r: Math.round(r *
|
How to Track Connections On a Server Accurately |
I'm going to make an assumption that you're using Apache. It should be
possible to parse the Apache logs to extract connections from unique IP
addresses. Hopefully the URL requested by the client will contain some sort
of path indicating that it was directed from Facebook.
Link:
Get unique visitors from apache log file
|
How to accurately checks flat the surfaces |
Assuming you havent yet, try playing with the motiongraphs sample
application (in xcode). It'll give you a better understanding of how you
might use a combination of "devicemotion" output such as roll, pitch, yaw;
as well as gyroscope readings.
Relying on accelerometer readings alone is going to be tricky for your
application idea (but maybe not impossible.) Accelerometer gives you a
measure of G-force, so while there is a detectable difference between
"flat" and "not so flat," there may be too much additional noise from other
factors such as hand movement or variance between legacy device types to
figure out a reliable algorithm.
|
How can I multiply and divide 64-bit ints accurately? |
It's easy to see that some inputs would produce outputs that cannot be
represented by the return type int64_t. For example, fn(INT64_MAX, 2, 1,
1). However, the following approach will should allow you to return a
correct answer for any combination of inputs that does in fact fit within
the range of int64_t.
int64_t fn(int64_t a, int32_t b, int32_t c, int32_t d)
{
/* find the integer and remainder portions of a/d */
int64_t leftI = a / d;
int64_t leftR = a % d;
/* multiply the integer portion of the result by b and c */
int64_t resultI = leftI * b * c;
/* multiply the remainder portion by b */
int64_t resultR = leftR * b;
resultI = resultI + (resultR / d) * c;
/* multiply the remainder portion by c */
resultR = (resultR % d) * c;
return resu
|
Playing periodic sound accurately on Android |
So you're depending on sleep being accurate. It isn't. It isn't designed
to be. It will sleep for at least that time, but may sleep for more. The
OS will not do a task switch back to that thread as soon as the sleep is
up, but as soon as it becomes the top priority thread in its scheduling
queue. You need a far more reliable way of waiting- something based on an
RTC.
An alarm based on the RTC alarm type might do it. I'm not sure if it
actually is an RTC interrupt that will send you an immediate alarm, or if
its just the relative clock it uses.
|
MongoDB slows down every 2 hours and 10 minutes accurately |
I think you mean a replicaset with 3 nodes instead of "3 replica set".
If you are still experiencing the same issue. Here is my opinion:
Since you are running your server in linode.com. Your server is actually a
virtual machine and you are sharing resources with others. The periodic
slow down may be due to others running having disk load periodically. Since
you have looked into so many different possibilities already, this may be
an option for you even it takes a bit of effort.
This is definitely caused by a job ran by mongodb or your system. Please
try to look for any job that runs regularly. For example, try to remove the
3600 seconds delay on one of your secondary. Even that is not 2 hour and 10
minutes, but that may be a trigger of it.
I can't post my suggestions in the comment si
|
Objective C : Getting the height and width of a UIView accurately |
From Apple docs
Discussion When a view’s bounds change, that view automatically
resizes its subviews according to each subview’s autoresizing mask.
You specify the value of this mask by combining the constants
described in UIViewAutoresizing using the C bitwise OR operator.
Combining these constants lets you specify which dimensions of the
view should grow or shrink relative to the superview. The default
value of this property is UIViewAutoresizingNone, which indicates that
the view should not be resized at all.
When more than one option along the same axis is set, the default
behavior is to distribute the size difference proportionally among the
flexible portions. The larger the flexible portion, relative to the
other flexible portions, the more it is lik
|
Extracting decimal part of a float accurately |
The simplest way to avoid problems with floating point precision is to cast
your number to a string and then only print what's after the point.
EDIT
I'm not sure how to do it with arduino's version of c++ so feel free to
edit my answer to add an example everyone!
|
Javascript - getting element box-shadow details accurately |
I hope this will help you get toward your goal. I made a regex, that
matches what the browser is outputting (the rgb is just the hex as an rgb).
It may need to be updated since I didn't test it in all browsers, but I
think it converts it to rgb so if there is an alpha, that can be handled
easily.
Here's the fiddle: http://jsfiddle.net/HQ7NF/2/
And here's the regex I am using:
var reBoxShadow = /(?:rgb((d+), ?(d+), ?(d+))([^,]*))+/g;
while ( style = reBoxShadow.exex(element.style.boxShadow) ) {
/* this is where stuff happens */
}
I then split the color and the args into separate variables, so you can
decide what to do with them. I hope that can at least get you on the right
track.
|
Haskell: How to benchmark a computation accurately with deepseq/force |
You can use force from Control.DeepSeq to fully evaluate a data structure
(and thus demand and measure its computation).
One problem is that forcing a large data structure takes some time itself!
This is because a deepseq (used by force) will walk down your algebraic
data type tree, visiting every node (but not doing anything with it).
When you perform only a cheap operation to each node, such as map (*2)
mylist, and try to measure how long it takes, this overhead can suddenly
become significant, messing up your measurements.
import Control.DeepSeq
import Control.Exception (evaluate)
import Data.Time (diffUTCTime, getCurrentTime)
-- | Measures how long a computation takes, printing both the time and the
-- overhead of `force` to stdout. So it forces *twice*.
benchmarkForce :: NFData
|
How to track distance accurately between two locations in windows phone using GPS? |
Are the "incorrect values" within a few dozen meters of the original
location? If so, what you might be seeing is just the inaccuracy of GPS.
GPS isn't 100% accurate. Even if your device isn't moving, the location
where the device's GPS thinks it is can change. In fact, your calculated
location might not be based on true GPS at all, but on Wi-Fi or on nearby
cell towers (A-GPS), both of which are much less accurate.
See this StackOverflow thread for more information. For debugging purposes,
I suggest displaying the HorizontalAccuracy somewhere on your UI to see if
the GPS drift is in line with expectations.
|
how can i get the max memory usage of a child process after its execution accurately? |
Once the process terminates, even though the process entry still exists in
the kernel, all of the resources for the process are released by the
kernel. So, I would not expect to be able to read the memory size of the
process from /proc.
In addition, there's no "maximum memory used" statistic for the process.
The only ways I can think to determine the maximum amount of memory for a
process are the following:
Periodically sample the process state while it's executing and grab the
current memory usage,
Use strace to capture all of the system calls made by the process and
process this to determine just how much memory the process used, or
Use a shared library to intercept the memory-allocation system calls as
they are made by the process, capture the details, and find a way to report
I
|
PHP not respecting RoundRobin in DNS |
We have recently encountered a similar problem as yours. We found out that
file_get_contents() eventually calls getaddrinfo(), which implements some
sorting algorithms from RFC3484.
The piece of snippet from php source code
PHPAPI int php_network_getaddresses(const char *host, int socktype, struct
sockaddr ***sal, zend_string **error_string)
{
// skip...
if ((n = getaddrinfo(host, NULL, &hints, &res))) {
if (error_string) {
*error_string = strpprintf(0, "php_network_getaddresses:
getaddrinfo failed: %s", PHP_GAI_STRERROR(n));
php_error_docref(NULL, E_WARNING, "%s",
ZSTR_VAL(*error_string));
} else {
php_error_docref(NULL, E_WARNING, "php_network_getaddresses:
getaddrinfo failed: %s", PHP_GAI_STRERROR(n));
}
|
Moving data from bundle to user doc folder not responding accurately |
You should have added the error parameter when copying the file and checked
what it contained...
Before you copy the file, ensure the destination directory exists using
createDirectoryAtPath:withIntermediateDirectories:attributes:error:.
|
Heatmap visualization does not accurately portray binary values in matrix in R |
The problem is that the number of colors is so small that the threshold to
be colored is not being met by most of pairs which have only "1" as an
entry. to tlook at the distribution of counts try:
table(test_matrix)
test_matrix
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
15
9434 2016 1 1 1 1 1 1 1 1 1 1 1 1 1
1
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
31
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
47
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
63
1
|
Is there any way to force Chrome to render fractional pixel font sizes accurately? |
The only workaround that occurs to me would involve applying
-webkit-transform: scale(x), example:
div[style*="10."] {-webkit-transform-origin: 0 50%;}
div[style*="10.1"] { -webkit-transform: scale(1.01);}
div[style*="10.2"] { -webkit-transform: scale(1.02);}
div[style*="10.3"] { -webkit-transform: scale(1.03);}
div[style*="10.4"] { -webkit-transform: scale(1.04);}
div[style*="10.5"] { -webkit-transform: scale(1.05);}
div[style*="10.6"] { -webkit-transform: scale(0.96);}
div[style*="10.7"] { -webkit-transform: scale(0.97);}
div[style*="10.8"] { -webkit-transform: scale(0.98);}
div[style*="10.9"] { -webkit-transform: scale(0.99);}
The problem, I guess, is that since you are auto-fitting text you are
probably getting element.offsetWidth which will give you the width before
the scaling. T
|
How can I output my generated heart beat signal at high BPM accurately using matlab? |
Change
delay = ((60/HR)/2)-(0.5*pulse_width);
into
delay = 30/HR;
tripuls does not change anything to the time input t1, so the pulse width
should not be subtracted from the time vector.
You can see this is correct by setting
pulse_width = 60e-4;
% (try)
pulse_width = 60e-10;
% (try again)
You should see that your results slowly go more and more towards the
correct HR (provided your external equipment is capable of handling such
short pulses).
|
Text is not respecting in Chrome and FF |
Simply add the style white-space: normal; to the p.
You have set white-space: nowrap; on the parent table element, and the p
inherited that. white-space: normal undoes that style.
|
Android Not Respecting my res folders |
Personaly I would use Screen pixel density (dpi) for each layout.
That is:
ldpi: Low-density screens; approximately 120dpi.
mdpi: Medium-density (on traditional HVGA) screens; approximately 160dpi.
hdpi: High-density screens; approximately 240dpi.
xhdpi: Extra high-density screens; approximately 320dpi.
Added in API Level 8
See
http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources
|
Supervisorctl not respecting my configuration |
You should run supervisorctl with -c as well. From the documentation (my
emphasis):
The Supervisor configuration file is conventionally named
supervisord.conf. It is used by both supervisord and supervisorctl. If
either application is started without the -c option (the option which
is used to tell the application the configuration filename
explicitly), the application will look for a file named
supervisord.conf within the following locations, in the specified
order. It will use the first file it finds.
$CWD/supervisord.conf
$CWD/etc/supervisord.conf
/etc/supervisord.conf
|
Table drop down selections not respecting Div |
Your table is close before including the <input> and the
<script> tags. You have a rogue </td> and </tr>. Move
</table> after the last </tr>.
|
border-radius not respecting z-index |
You forgot to position the header - add position: relative; to the
<h2>
http://jsfiddle.net/Ms7Qr/1/ (z-index doesn't apply to a statically
positioned elements)
From the Visual Formatting Model:
Other stacking contexts are generated by any positioned element
(including relatively positioned elements) having a computed value of
'z-index' other than 'auto'.
|
iframe in FireFox not respecting z-index |
Try adding wmode, it seems to have two parameters.
&wmode=Opaque
&wmode=transparent
<iframe title="YouTube video player" width="480" height="390"
src="http://www.youtube.com/embed/lzQgAR_J1PI?wmode=transparent"
frameborder="0" wmode="Opaque">
For more info
check
YouTube Video Embedded via iframe Ignoring z-index?
|
PHP streaming upload via XHR PUT not respecting boundaries |
Multipart data is handled by PHP only on POST requests. With PUT you have
direct access to bytestream and you need to handle it for yourself.
If something changes, this bug report / feature request will be closed
|
How to bootstrap respecting within-subject information? |
Just modify your call to boot() like this:
data.boot <- boot(data, boot.huber, 1999, strata=data$Subject)
?boot provides this description of the strata= argument, which does exactly
what you are asking for:
strata: An integer vector or factor specifying the strata for
multi-sample problems. This may be specified for any
simulation, but is ignored when ‘sim = "parametric"’. When
‘strata’ is supplied for a nonparametric bootstrap, the
simulations are done within the specified strata.
Additional note:
To confirm that it's working as you'd like, you can call debugonce(boot),
run the call above, and step through the debugger until the object i (whose
rows contain the indices used to resample rows of data to create each
bootstr
|
UIView animateWithDuration not respecting delay |
My suggestion would be to set the delay to 0, and place the subsequent
UIView animation blocks in the completion block of the previous
animateWithDuration statements:
[UIView animateWithDuration:0.4 delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^(void) {
[_IntroLabel1 setAlpha:1];
}
completion:^(BOOL finished){
[UIView animateWithDuration:0.4 delay:2.6
options:UIViewAnimationOptionCurveEaseInOut
animations:^(void) {
[_IntroLabel2 setAlpha:1];
[_IntroLabel1 setAlpha:0];
[_IntroLabel1
setCenter:CGPointMake(0, _IntroLabe
|
CSS Background on body not respecting width |
body {
max-width: 300px;
background-image:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAABvUlEQVR42u2b2Y7DIAxFx4j//2XPQ6UoTUYdUDBeevxcNXB8vREiqvqDjVkDAbBMrP/7CxFZ9bDsId9HGK3a5ELuLp6Q4xn3neQSgpEnzhB6mUixWPnFAa1STqEaAgtYwMKABSxgAQtYwMKABSxgAQtYxex+mgisT3Y54AMWYZgXlulLHZQFrPxac1NWRl4+sJK+c2voaHzBDR2NL7tF816CMNy/7oxya9mDZTesMh32JmUhq0Ctw5/OUNVcomY2BBawvh1WrsLSE63V4ra5m7JEZM9N91cZ3V9J+9rNnPdg5PzX36ZX1sX59QbvZrEfuzDxLQhtIaaDlMWuRMS9dPb4Pj/7oGzrcB79Hm41SDtm25SqaqXzjB1N6f10YZxgqGOJTR38hc5Uto6jTZ9xZySdBTzqcpsNP3xBG3bM9h+kE1UAzrOABSxgAQtYGLCABSxgAauE8aHTo4kVWIQhsIAFLGBhwJqEle7WsLOy4EUYLp54gDUx8bx96EQkEobAcodFJE4rC14TsNDXKCy+0pxO8IiLagisjdapho9gkeZHwxBZTfdZcCHBl07w0e/Bh1pftAQqZChyFrC87Rc9QsO8Gm6jLgAAAABJRU5ErkJggg==");
backgroun
|
9 patch not respecting fill area |
you must use an xml resource for that and place your src into the xml
<?xml version="1.0" encoding="utf-8"?>
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg" >
</nine-patch>
and your bg should be like bg.9.png
|
DropDownListFor not respecting Selected property of SelectList |
This tends to stump people a lot - apparently the roadmap for MVC 5
includes more intuitive DropDownList helpers.
When you do:
@Html.DropDownListFor(x => x.TimeOption ...)
... the HTML helper will do everything in its power not to use the value
you set to Selected = true in your SelectList. It will:
Try to get it from ModelState - which it won't get on the GET request
Try to get it from ViewData - which it will get, because you have a
TimeOption property on your model.
Only if both of those attempts fail, will it succumb, and use what you
asked it to use.
So, in your case, it will use the current value of TimeOption on your model
as the selected value. Which should be fine, because that's what you asked
for in your SelectList anyway ((int)Model.TimeOption), right?
Wrong. Becau
|