问:
Use mobilenet V1 model on Android
I'm trying to use the model used on this tutorial in an Android app. I wanted to modify DetectorActivity.java and TensorFlowMultiBoxDetector.java found here but it seems like i miss some parameters as imageMean, imageStd, inputName, outputLocationsName and outputScoresName.

From what I understand, input name is the name of the input for the model and both outputs are the names for the position and score output, but what do imageMean and imageStd stand for ?

I don't need to use the model with a camera, I just need to detect objects on bitmaps.

答: Your understanding of input/output names seems correct. They are tensorflow node names that can receive input and will contain the outputs at the end. imageMean and imageStd are used to scale the RGB values of the image to the mean of 0 and the standard deviation of 1. See the 8 lines starting from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowMultiBoxDetector.java#L208

Title: Use mobilenet V1 model on Android


来源: stackexchange

问:
Basic Flow Control in JavaScript
Could you, please, explain to me, how to write really basic flow control in JavaScript? Thank you.</p>

```<code>flow([

  function(callback) { /* do something */ callback(); /* run next function */ },
  function(callback) { /* do something */ callback(); /* run next function */ },
  function(callback) { /* do something */ callback(); /* run next function */ },
  function(callback) { /* do something */ callback();  }

], function() {

  alert("Done.");

});
</code>```

答:
```<code>// callback is a global function, I assume

function flow(funcArr, funcEnd) {
    for (var i = 0; i < funcArr.length; i++) {
        funcArr[i](callback);
    }
    funcEnd();
}
</code>```

This would run all those functions.

ContentLicense: CC BY-SA 2.5

Title: Basic Flow Control in JavaScript

Body:
Could you, please, explain to me, how to write really basic flow control in JavaScript? Thank you.

flow([

  function(callback) { /* do something */ callback(); /* run next function */ },
  function(callback) { /* do something */ callback(); /* run next function */ },
  function(callback) { /* do something */ callback(); /* run next function */ },
  function(callback) { /* do something */ callback();  }

], function() {

  alert("Done.");

});

Body:
// callback is a global function, I assume

function flow(funcArr, funcEnd) {
    for (var i = 0; i < funcArr.length; i++) {
        funcArr[i](callback);
    }
    funcEnd();
}

This would run all those functions.


问:
I can't link IBOutlets in ViewController.swift
I'm new to iOS programing and to start off I am trying to create a table view in the storyboard. After creating it and linking it to the view controller as a data source, I tried to link it to ViewController.Swift but it would't allow me to put an IBOUtlet or an IBAction. I made a few new projects and tried to create the IBOutlet but it wouldn't let me do it on those either. I don't understand what's wrong, and could someone please help me fix this?</p>

答:
I also met the same issue that IBOutlet and IBAction can not be declared in the ViewController. I can share my solutions to these issues:

Open your project Main.storyboad;

Select the view with yellow button;

Open Show the Identity Editor, and change the Class to your declared object.

After the steps above, you should use Ctrl-Drag to the corresponding view controller.

In general, it should be the first step to confirm which view controller will use your IBAction and IBOutlet. Then change the Class to its your own desired class.

ContentLicense: CC BY-SA 3.0


问:
EXCEL - Multiple Arrays within COUNTIF formula
Attempting to count:

Named range "STATUS" if the value of the cells equals Reserved, Blocked, Pending OR Archive

AND

Named range "COMPANY" equals Company A, Company B OR Company C.

I'm also counting multiple other criteria, all of the which are working. When I added the array for the Company the formula is no longer counting the Status.

Here is the formula I'm using:

```<code>=SUM((COUNTIFS(DATES,">="&A19,DATES,"<"&EDATE(A19,1),AGENT,"JOHN DOE",COMPANY,{"COMPANY A","COMPANY B","COMPANY C"},STATUS,{"Reserved","Blocked","Pending","Archive"})))
</code>```

Any help is greatly appreciated and thank you in advance!

答:
you can create additional column with all of the conditions you need as if inside an IF condition, e.g.

```<code>=(A2>=A19) * ((B2="COMPANY A") + (B2="COMPANY B")))
</code>```

and then =COUNTIF(ALL_CONDITIONS, ">0")

Body:
Attempting to count:

Named range "STATUS" if the value of the cells equals Reserved, Blocked, Pending OR Archive

AND

Named range "COMPANY" equals Company A, Company B OR Company C.

I'm also counting multiple other criteria, all of the which are working. When I added the array for the Company the formula is no longer counting the Status.

Here is the formula I'm using:

=SUM((COUNTIFS(DATES,">="&A19,DATES,"<"&EDATE(A19,1),AGENT,"JOHN DOE",COMPANY,{"COMPANY A","COMPANY B","COMPANY C"},STATUS,{"Reserved","Blocked","Pending","Archive"})))

Any help is greatly appreciated and thank you in advance!

Body:
you can create additional column with all of the conditions you need as if inside an IF condition, e.g.

=(A2>=A19) * ((B2="COMPANY A") + (B2="COMPANY B")))

and then =COUNTIF(ALL_CONDITIONS, ">0")


问:
Context menu with list view
My code is not showing any Toast.When i long push it shows three menu but when i select any menu like "delete" it does not show Toast, What can I do so that it work. I have tried with answer on this site but not get success. Here is my code.

```<code> package com.example.avinashkumaryadav.menutwo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Adapter;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
ListView lview;
String[] contact={"Avinash","Golu","Sam","Tom","Ram","Yam"};

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    lview=(ListView)findViewById(R.id.linearId) ;
    ArrayAdapter Array=new ArrayAdapter<String>(this,R.layout.linear_view,R.id.linearView,contact);
    lview.setAdapter(Array);
    registerForContextMenu(lview);
}

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    menu.setHeaderTitle("Select Action");
    menu.add(0,v.getId(),0,"Love");
    menu.add(0,v.getId(),0,"Edit");
    menu.add(0,v.getId(),0,"delete");
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if(item.getTitle()=="Love") {
        Toast.makeText(MainActivity.this, "Love u too dear", Toast.LENGTH_LONG).show();
    }
    else if(item.getTitle()=="Edit")
    {
        Toast.makeText(getApplicationContext(),"Editable",Toast.LENGTH_SHORT).show();
    }
    else if(item.getTitle()=="delete")
    {
        Toast.makeText(getApplicationContext(),"Can be Deleted",Toast.LENGTH_SHORT).show();
    }
  else
       {
          Toast.makeText(this,"Not clicked right",Toast.LENGTH_SHORT);
       }
       return true;

   }
 }
</code>```

Cany anyone help me please?

答:
In Java you must compare strings with .equals() and not ==.

Also, it looks like you are inflating a ContextMenu. You need to implement onContextItemSelected(MenuItem item) and not onOptionsItemSelected(MenuItem).

Take a look here: https://developer.android.com/guide/topics/ui/menus.html and scroll down to create a floating context menu.

Title: Context menu with list view

Body:
My code is not showing any Toast.When i long push it shows three menu but when i select any menu like "delete" it does not show Toast, What can I do so that it work. I have tried with answer on this site but not get success. Here is my code.

 package com.example.avinashkumaryadav.menutwo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Adapter;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
ListView lview;
String[] contact={"Avinash","Golu","Sam","Tom","Ram","Yam"};

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    lview=(ListView)findViewById(R.id.linearId) ;
    ArrayAdapter Array=new ArrayAdapter<String>(this,R.layout.linear_view,R.id.linearView,contact);
    lview.setAdapter(Array);
    registerForContextMenu(lview);
}

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    menu.setHeaderTitle("Select Action");
    menu.add(0,v.getId(),0,"Love");
    menu.add(0,v.getId(),0,"Edit");
    menu.add(0,v.getId(),0,"delete");
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if(item.getTitle()=="Love") {
        Toast.makeText(MainActivity.this, "Love u too dear", Toast.LENGTH_LONG).show();
    }
    else if(item.getTitle()=="Edit")
    {
        Toast.makeText(getApplicationContext(),"Editable",Toast.LENGTH_SHORT).show();
    }
    else if(item.getTitle()=="delete")
    {
        Toast.makeText(getApplicationContext(),"Can be Deleted",Toast.LENGTH_SHORT).show();
    }
  else
       {
          Toast.makeText(this,"Not clicked right",Toast.LENGTH_SHORT);
       }
       return true;

   }
 }

Cany anyone help me please?


问:
MNIST image prediction model
I am new to tensorflow and i have a quick question, here is the code of my model for MNIST

```<code>def neural_network_model(data):

    hidden_1_layer = {'weights': tf.Variable(tf.random_normal([784, n_nodes_hl1])),
                      'biases': tf.Variable(tf.random_normal([n_nodes_hl1]))}

    hidden_2_layer = {'weights': tf.Variable(tf.random_normal([n_nodes_hl1, n_nodes_hl2])),
                      'biases': tf.Variable(tf.random_normal([n_nodes_hl2]))}

    hidden_3_layer = {'weights': tf.Variable(tf.random_normal([n_nodes_hl2, n_nodes_hl3])),
                      'biases': tf.Variable(tf.random_normal([n_nodes_hl3]))}

    output_layer = {'weights': tf.Variable(tf.random_normal([n_nodes_hl3, n_classes])),
                    'biases': tf.Variable(tf.random_normal([n_classes])), }
    l1 = tf.add(
        tf.matmul(
            data,
            hidden_1_layer['weights']),
        hidden_1_layer['biases'])
    l1 = tf.nn.relu(l1)

    l2 = tf.add(
        tf.matmul(
            l1,
            hidden_2_layer['weights']),
        hidden_2_layer['biases'])
    l2 = tf.nn.relu(l2)

    l3 = tf.add(
        tf.matmul(
            l2,
            hidden_3_layer['weights']),
        hidden_3_layer['biases'])
    l3 = tf.nn.relu(l3)

    output = tf.matmul(l3, output_layer['weights']) + output_layer['biases']

    return output
</code>```

my question is that does this function represents the output values for input 'data' ? or this function represents a complete model that will be used for testing / predicting images after training?

Here is the code that I used for prediction of a particular image :

```<code>prediction=neural_network_model(mnist_training_data_set)
p=tf.argmax(prediction,1)
print(p.eval(feed_dict={x: i}, session=sess))
</code>```

So here I am confused , whether that function is a model or returns only predicted outputs. Can anyone explain, Thanks

答:
This function creates the model and adds it to the computation graph. The predicted outputs will be returned by the p.eval(feed_dict={x: i}, session=sess) line.

As such, the function returns the output layer of the model, which is what you will use to make predictions. Arguably you could call this the "model", but I think that it would be better to call the session variable the "model".

Title: MNIST image prediction model

Body:
I am new to tensorflow and i have a quick question, here is the code of my model for MNIST

def neural_network_model(data):

    hidden_1_layer = {'weights': tf.Variable(tf.random_normal([784, n_nodes_hl1])),
                      'biases': tf.Variable(tf.random_normal([n_nodes_hl1]))}

    hidden_2_layer = {'weights': tf.Variable(tf.random_normal([n_nodes_hl1, n_nodes_hl2])),
                      'biases': tf.Variable(tf.random_normal([n_nodes_hl2]))}

    hidden_3_layer = {'weights': tf.Variable(tf.random_normal([n_nodes_hl2, n_nodes_hl3])),
                      'biases': tf.Variable(tf.random_normal([n_nodes_hl3]))}

    output_layer = {'weights': tf.Variable(tf.random_normal([n_nodes_hl3, n_classes])),
                    'biases': tf.Variable(tf.random_normal([n_classes])), }
    l1 = tf.add(
        tf.matmul(
            data,
            hidden_1_layer['weights']),
        hidden_1_layer['biases'])
    l1 = tf.nn.relu(l1)

    l2 = tf.add(
        tf.matmul(
            l1,
            hidden_2_layer['weights']),
        hidden_2_layer['biases'])
    l2 = tf.nn.relu(l2)

    l3 = tf.add(
        tf.matmul(
            l2,
            hidden_3_layer['weights']),
        hidden_3_layer['biases'])
    l3 = tf.nn.relu(l3)

    output = tf.matmul(l3, output_layer['weights']) + output_layer['biases']

    return output

my question is that does this function represents the output values for input 'data' ? or this function represents a complete model that will be used for testing / predicting images after training?

Here is the code that I used for prediction of a particular image :

prediction=neural_network_model(mnist_training_data_set)
p=tf.argmax(prediction,1)
print(p.eval(feed_dict={x: i}, session=sess))

So here I am confused , whether that function is a model or returns only predicted outputs. Can anyone explain, Thanks


问:
How to cast JSTL variable to string in Liferay JSP?
I habe a problem with my latest Liferay Portlet or rather a JSP I'm using in this portlet.
I am using a string array that contains strings which are shown on the page with a delete-button. Each of these buttons calls an actionURL to submit the selected data to another function.
Maybe it's easier to understand what I want to do by just looking at my example code:

```<code><c:forEach var="name" items="<%=myNames %>">
    <liferay-portlet:actionURL name="deleteName" var="${name}">
        <liferay-portlet:param name="myName" value="${name}" />
    </liferay-portlet:actionURL>
    <c:out value="${name}" />
    <liferay-ui:icon-delete label="<%= true %>" url="${name}"/>
</c:forEach>
</code>```

Maybe you already noticed what my problem is: the var-attribute in the actionURL has to be a string. That's why this example doesn't work.
My question is now: how can I cast my $name variable dynamically to set it int the actionURL and later call it with the icon?

Thank you.

答:
```<code><%
List<String> names = new ArrayList<String>();
names.add("me");
names.add("myself");
names.add("I");

pageContext.setAttribute("names", names);
%>

<c:forEach var="name" items="${names}">
    <portlet:actionURL var="deleteURL">
        <portlet:param name="myName" value="${name}" />
    </portlet:actionURL>

    <liferay-ui:icon-delete label="<%= true %>" url="${deleteURL}"/>
</c:forEach>
</code>```

Does this work for you?

Body:
I habe a problem with my latest Liferay Portlet or rather a JSP I'm using in this portlet.
I am using a string array that contains strings which are shown on the page with a delete-button. Each of these buttons calls an actionURL to submit the selected data to another function.
Maybe it's easier to understand what I want to do by just looking at my example code:

<c:forEach var="name" items="<%=myNames %>">
    <liferay-portlet:actionURL name="deleteName" var="${name}">
        <liferay-portlet:param name="myName" value="${name}" />
    </liferay-portlet:actionURL>
    <c:out value="${name}" />
    <liferay-ui:icon-delete label="<%= true %>" url="${name}"/>
</c:forEach>

Maybe you already noticed what my problem is: the var-attribute in the actionURL has to be a string. That's why this example doesn't work.
My question is now: how can I cast my $name variable dynamically to set it int the actionURL and later call it with the icon?

Thank you.

Body:
<%
List<String> names = new ArrayList<String>();
names.add("me");
names.add("myself");
names.add("I");

pageContext.setAttribute("names", names);
%>

<c:forEach var="name" items="${names}">
    <portlet:actionURL var="deleteURL">
        <portlet:param name="myName" value="${name}" />
    </portlet:actionURL>

    <liferay-ui:icon-delete label="<%= true %>" url="${deleteURL}"/>
</c:forEach>

Does this work for you?


问:
Monitor Mininet OpenFLow Traffic in WireShark with RYU Controller
I am using RYU controller for SDN Setup. I want to monitor basic openflow handshake messages but i have failed to do so..

Here are the steps i do after install of mininet, wireshark and ryu.

```<code>./bin/ryu-manager --verbose ryu/app/simple_switch_13.py
</code>```

step 2: start virtual network

```<code>sudo mn --top single,3 --man --controller remote --switch ovsk,Protocols=OpenFLow13
</code>```

Now no traffic shows up in my wireshark.. I am using wireshark version 1.12 which has an openflow dissector installed in it.

When i use capture loop it shows the request and reply packets, but i want to see "Feature Request" From ryu controller in wireshark

答:
Here is what i did:

Be sure "openvswitch-testcontroller" is down:

```<code>yavuz@ubuntu:/tmp$ service --status-all | grep openv
 [ + ]  openvswitch-switch
 [ - ]  openvswitch-testcontroller
</code>```

Run ryu application:

```<code>yavuz@ubuntu:~/ryu$ pwd
/home/yavuz/ryu
yavuz@ubuntu:~/ryu$ sudo ryu-manager --verbose ryu/app/example_switch_13.py
lzma module is not available
Registered VCS backend: git
Registered VCS backend: hg
Registered VCS backend: svn
Registered VCS backend: bzr
loading app ryu/app/example_switch_13.py
</code>```

Before mininet run tcpdump for lo (not eth0 or like that)

```<code>sudo tcpdump -i lo -w ryu-local.cap
</code>```

Run mininet:

```<code>yavuz@ubuntu:/tmp$ sudo mn --topo single,3 --controller=remote --mac
*** Creating network
*** Adding controller
Connecting to remote controller at 127.0.0.1:6653
*** Adding hosts:
h1 h2 h3
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1) (h3, s1)
*** Configuring hosts
h1 h2 h3
*** Starting controller
c0
*** Starting 1 switches
s1 ...
*** Starting CLI:
mininet> h1 ping h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=8.38 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.228 ms
</code>```

Stop the trace and open it.

Hope this helps.

Body:
I am using RYU controller for SDN Setup. I want to monitor basic openflow handshake messages but i have failed to do so..

Here are the steps i do after install of mininet, wireshark and ryu.

./bin/ryu-manager --verbose ryu/app/simple_switch_13.py

step 2: start virtual network

sudo mn --top single,3 --man --controller remote --switch ovsk,Protocols=OpenFLow13

Now no traffic shows up in my wireshark.. I am using wireshark version 1.12 which has an openflow dissector installed in it.

When i use capture loop it shows the request and reply packets, but i want to see "Feature Request" From ryu controller in wireshark

Body:
Here is what i did:

Be sure "openvswitch-testcontroller" is down:

yavuz@ubuntu:/tmp$ service --status-all | grep openv
 [ + ]  openvswitch-switch
 [ - ]  openvswitch-testcontroller

Run ryu application:

yavuz@ubuntu:~/ryu$ pwd
/home/yavuz/ryu
yavuz@ubuntu:~/ryu$ sudo ryu-manager --verbose ryu/app/example_switch_13.py
lzma module is not available
Registered VCS backend: git
Registered VCS backend: hg
Registered VCS backend: svn
Registered VCS backend: bzr
loading app ryu/app/example_switch_13.py

Before mininet run tcpdump for lo (not eth0 or like that)

sudo tcpdump -i lo -w ryu-local.cap

Run mininet:

yavuz@ubuntu:/tmp$ sudo mn --topo single,3 --controller=remote --mac
*** Creating network
*** Adding controller
Connecting to remote controller at 127.0.0.1:6653
*** Adding hosts:
h1 h2 h3
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1) (h3, s1)
*** Configuring hosts
h1 h2 h3
*** Starting controller
c0
*** Starting 1 switches
s1 ...
*** Starting CLI:
mininet> h1 ping h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=8.38 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.228 ms

Stop the trace and open it.

Hope this helps.


问:
Azure Media Services Limit File Size
Looking at the Azure Media Service REST API I can't see any way to limit the upload size of a file:

https://learn.microsoft.com/en-us/azure/media-services/media-services-rest-upload-files

For example I want a user to directly upload a file to azure but limit it to 50mb. I don't want to proxy the request via my servers first because that seems like unnecessary bandwidth usage.

Is it possible to do this with Azure? If it isn't possible to do it directly on Azure what is the best way to indirectly restrict the file upload size?

答:
If you are not using proxy solution, you are exposing to end users Azure storage Shared Access signature. There is no any size limitations associated with it. Only mitigationyou can take is restrict time during which saas signature is valid, so users have time limited time frame to do upload. Any validations on client will only partually mitigate the problem of uploading big files. As mentioned before users can take saas link from ui by debugging client side script and upload any content size to it within time frame link is valid.

Azure storage not exposing any apis to limit file upload size,so right now only bullet proof solution for your scenario is to use proxy.

Title: Azure Media Services Limit File Size


问:
How to fix Uncaught ReferenceError: exports is not defined
I try to use TypeScript and I have error like that:

```<code>Uncaught ReferenceError: exports is not defined
    at main.js:2
</code>```

Here is my tsconfig.js:

```<code>{
    "files": [
        "source/ts/**/*.ts"
    ],
    "compilerOptions": {
        "noImplicitAny": true,
        "target": "es5",
        "outDir": "js",
        "rootDir": "source/ts"
    }
}
</code>```

This error occured when I try to invoke imported function.
Did I forget something in configuration?

答:
This error occured when I try to invoke imported function. Did I forget something in configuration?

You cannot use modules (or imports) in the browser natively at the moment. Please use a module bundler e.g. webpack

More

A webpack TypeScript quickstart : https://basarat.gitbooks.io/typescript/content/docs/quick/browser.html

Body:
I try to use TypeScript and I have error like that:

Uncaught ReferenceError: exports is not defined
    at main.js:2

Here is my tsconfig.js:

{
    "files": [
        "source/ts/**/*.ts"
    ],
    "compilerOptions": {
        "noImplicitAny": true,
        "target": "es5",
        "outDir": "js",
        "rootDir": "source/ts"
    }
}

This error occured when I try to invoke imported function.
Did I forget something in configuration?


问:
Format date in angularJS
I have a date in this format "2017-06-26 10:21:25.88785". My purpose is to show this kind of format 'dd/MM/yyyy hh:mm:ss', and put this date into a ng-table. So, I write in my ng-table

```<code>{{::fondo.aggTms | date:'dd/MM/yyyy hh:mm:ss'}}
</code>```

Where fondo is my variable and aggTms is the attribute of the main variable.
Unfortunately, it doesn't work, and in my table is shown the first (wrong) format.
Anyone could help me?

答:
You can try rounding of last seconds part Then covert it into date & then try the angular filter. the function to be called in place of fondo.aggTms is

```<code>$scope.toDate = function(date){
    var res = date.split(":");
    var last = window.Math.round(res[2]);
    var datestring = res[0]+':'+res[1]+':'+last;
    var d = new Date(datestring);
    return d;
}

{{::toDate(fondo.aggTms) | date:'dd/MM/yyyy HH:mm:ss'}}
</code>```

This is the working plunker link: https://plnkr.co/edit/7OHqUmxnjfs89mCMCF3M?p=preview

Now this's only valid if you're considering that last part as seconds in decimal.

Title: Format date in angularJS

Body:
I have a date in this format "2017-06-26 10:21:25.88785". My purpose is to show this kind of format 'dd/MM/yyyy hh:mm:ss', and put this date into a ng-table. So, I write in my ng-table

{{::fondo.aggTms | date:'dd/MM/yyyy hh:mm:ss'}}

Where fondo is my variable and aggTms is the attribute of the main variable.
Unfortunately, it doesn't work, and in my table is shown the first (wrong) format.
Anyone could help me?

Body:
You can try rounding of last seconds part Then covert it into date & then try the angular filter. the function to be called in place of fondo.aggTms is

$scope.toDate = function(date){
    var res = date.split(":");
    var last = window.Math.round(res[2]);
    var datestring = res[0]+':'+res[1]+':'+last;
    var d = new Date(datestring);
    return d;
}

{{::toDate(fondo.aggTms) | date:'dd/MM/yyyy HH:mm:ss'}}

This is the working plunker link: https://plnkr.co/edit/7OHqUmxnjfs89mCMCF3M?p=preview

Now this's only valid if you're considering that last part as seconds in decimal.


问:
HttpURLConnection Get Connection
I'm trying to create get connection but when i read header on server i found request Method received as POST not GET

答:
Try removing this line: connection.setDoOutput(true);

It may make the urlconnection think that you want to put parameters in the body and that you're trying to do a post

Title: HttpURLConnection Get Connection


问:
empty space at bottom when tabbar is hidden
In a TabBar based app , on a particular ViewController TabBar is hidden. on that view there is a table. That table is leaving space at bottom , the height of space is same as of TabBar. How to fix that ??

答: You can achieve above things by using UIContainerView for tabbar controller</p>


问:
Django image does not display in template
I am using Django and i want to import an image to my about.html file

Both the picture and the about.html are in the same file, see the picture down

i am trying to insert the image like this, but i get a broken picture icon

```<code><img src="templates/WebApp/rolomatik_logo_crna_verzija.png"
</code>```

Any suggestions please?

答:
You should create a folder static in your app. Inside that you have to create another folder with name same as your app name. In your case it should be SmartApp/static/SmartApp/ and put your image in the folder.

After this use {% load static %} at the top of your template,inside your  tag. After this you can use the image like this:

Body:
I am using Django and i want to import an image to my about.html file

Both the picture and the about.html are in the same file, see the picture down

i am trying to insert the image like this, but i get a broken picture icon

<img src="templates/WebApp/rolomatik_logo_crna_verzija.png"

Any suggestions please?

Body:
You should create a folder static in your app. Inside that you have to create another folder with name same as your app name. In your case it should be SmartApp/static/SmartApp/ and put your image in the folder.

After this use {% load static %} at the top of your template,inside your <head> tag. After this you can use the image like this:

<img src="{% static 'SmartApp/rolomatik_logo_crna_verzija.png' %}" >


问:
Push Plugin for ANDROID IONIC 2 not working in prod mode, but works in dev mode
[The very same code working fine in dev mode..getting pushes. but in prod build iam getting the error push plugin not installed.Check the below image]

https://i.stack.imgur.com/wMqIE.png

答: I think you should do build prod with this plugin. looks like the plugin isn't part of the build that you did.</p>


问:
override default docker run from host with options/arguments
```<code>FROM alpine:3.5
CMD ["echo", "hello world"]
</code>```

So after building docker build -t hello . I can run hello by calling docker run hello and I get the output hello world.

Now let's assume I wish to run ls or sh - this is fine. But what I really want is to be able to pass arguments. e.g. ls -al, or even tail -f /dev/null to keep the container running without having to change the Dockerfile

How do I go about doing this? my attempt at exec mode fails miserably... docker run hello --cmd=["ls", "-al"]

答:
Anything after the image name in the docker run command becomes the new value of CMD. So you can run:

```<code>docker run hello ls -al
</code>```

Note that if an ENTRYPOINT is defined, the ENTRYPOINT will receive the value of CMD as args rather than running CMD directly. So you can define an entrypoint as a shell script with something like:

```<code>#!/bin/sh

echo "running the entrypoint code"

# if no args are passed, default to a /bin/sh shell
if [ $# -eq 0 ]; then
  set -- /bin/sh
fi

# run the "CMD" with exec to replace the pid 1 of this shell script
exec "$@"
</code>```

Body:
FROM alpine:3.5
CMD ["echo", "hello world"]

So after building docker build -t hello . I can run hello by calling docker run hello and I get the output hello world.

Now let's assume I wish to run ls or sh - this is fine. But what I really want is to be able to pass arguments. e.g. ls -al, or even tail -f /dev/null to keep the container running without having to change the Dockerfile

How do I go about doing this? my attempt at exec mode fails miserably... docker run hello --cmd=["ls", "-al"]

Body:
Anything after the image name in the docker run command becomes the new value of CMD. So you can run:

docker run hello ls -al

Note that if an ENTRYPOINT is defined, the ENTRYPOINT will receive the value of CMD as args rather than running CMD directly. So you can define an entrypoint as a shell script with something like:

#!/bin/sh

echo "running the entrypoint code"

# if no args are passed, default to a /bin/sh shell
if [ $# -eq 0 ]; then
  set -- /bin/sh
fi

# run the "CMD" with exec to replace the pid 1 of this shell script
exec "$@"


问:
Flask-jwt-extended doesn't support required claims?
I'm using flask-jwt-extended over flask-jwt but there doesn't seem to be support for requiring claims.

Is this something I have to implement myself in a new identity function and if so how do I override the existing functionality in flask-jwt-extended?

答:
Author here. For what it's worth, flask-jwt doesn't support requiring claims either (even though it says it does). https://github.com/mattupstate/flask-jwt/issues/98

EDIT:
This is now available in flask-jwt-extended. https://github.com/vimalloc/flask-jwt-extended/issues/64#issuecomment-318800617

Cheers


问:
Total number of pages in itext footer not showing
I am generating a PDF in my application using itext. In the footer part, a phrase containing page X of Y is there. The total number of pages is not showing after PDF creation. Please refer the below code:

in MainActivity:

```<code>        PdfPTable table = new PdfPTable(2);
        table.setSpacingAfter(40.0f);
        table.setTotalWidth(document.right()-document.left()-100);

        try {
            table.setWidths(new int[]{1, 2});
        } catch (DocumentException e) {
            e.printStackTrace();
        }
        PdfPCell cellOne = new PdfPCell(img);

        Font f=new Font(Font.FontFamily.TIMES_ROMAN,20.0f,Font.BOLD, BaseColor.BLACK);
        Font Para1_font=new Font(Font.FontFamily.TIMES_ROMAN,15.0f,Font.BOLD, BaseColor.BLACK);
        Paragraph paragraph1_header = new Paragraph("QUOTE TO: 294087",f);
        Paragraph paragraph = new Paragraph();
        paragraph.add("AAAAAAAAAALLC * hhjkhhhhuhjbbnb" +
                      "jgjkll;, Sjklkjjjhh * AAHHGBJJ");

       // Paragraph paragraph3 = new Paragraph();
       // paragraph3.add("Page 1");
        paragraph.setAlignment(Paragraph.ALIGN_LEFT);
        PdfPCell cellTwo = new PdfPCell(paragraph);
      //  PdfPCell cellThree = new PdfPCell(paragraph3);

        cellTwo.setPaddingLeft(10.0f);
        cellOne.setPaddingBottom(20.0f);
        cellTwo.setPaddingBottom(20.0f);
        cellThree.setPaddingBottom(20.0f);
        cellOne.setBorder(Rectangle.NO_BORDER);
        cellTwo.setBorder(Rectangle.NO_BORDER);
        cellThree.setBorder(Rectangle.NO_BORDER);
        cellOne.setHorizontalAlignment(Element.ALIGN_LEFT);
        cellTwo.setHorizontalAlignment(Element.ALIGN_LEFT);
        cellThree.setHorizontalAlignment(Element.ALIGN_RIGHT);
        table.addCell(cellOne);
        table.addCell(cellTwo);
        //table.addCell(cellThree);

        try {
            HeaderFooterPageEvent event = new HeaderFooterPageEvent(this, table);
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(path));
            //writer.setBoxSize("art", new Rectangle(36, 54, 559, 788));
            writer.setPageEvent(event);
            document.open();
</code>```

inside HeaderFooterPageEvent class:

```<code>public void onOpenDocument(PdfWriter writer, Document document) {
    total = writer.getDirectContent().createTemplate(30, 16);
    try {
        totalPages = Image.getInstance(total);
    } catch (BadElementException e) {
        e.printStackTrace();
    }
    totalPages.setRole(PdfName.ARTIFACT);
}
public void onEndPage(PdfWriter writer, Document document) {

    footer.writeSelectedRows(0, -100, 36, 65, writer.getDirectContent());
    try {
        PdfPCell cell = new PdfPCell(Image.getInstance(total));
    } catch (BadElementException e) {
        e.printStackTrace();
    }

        Phrase footerPhrase = new Phrase("Page "+writer.getPageNumber()+
            " of");
    footerPhrase.add(new Chunk(totalPages,0,0,true));

        ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, footerPhrase, 500, 65, 0);

    }
</code>```

Its just showing " Page x of" instead of " Page X of Y". Is there something I am missing? Please help.

答:
You have implemented the onOpenDocument method to create a PdfTemplate of size 30, 16 (isn't that rather small?) and you are adding this empty placeholder on every page in the onEndPage method.

However, I don't see you adding content to the PdfTemplate anywhere. If you don't add the total number of pages, then you won't see the total number of pages anywhere in your document.

Since you can only know the total number of pages at the moment you close the document, you need to implement the onCloseDocument():

```<code>public void onCloseDocument(PdfWriter writer, Document document) {
    ColumnText.showTextAligned(total, Element.ALIGN_LEFT,
            new Phrase(String.valueOf(writer.getPageNumber() - 1)),
            2, 2, 0);
}
</code>```

See MovieCountries1 for a full example. This example was written in the context of the second edition of the book "iText in Action."

Body:
I am generating a PDF in my application using itext. In the footer part, a phrase containing page X of Y is there. The total number of pages is not showing after PDF creation. Please refer the below code:

in MainActivity:

        PdfPTable table = new PdfPTable(2);
        table.setSpacingAfter(40.0f);
        table.setTotalWidth(document.right()-document.left()-100);

        try {
            table.setWidths(new int[]{1, 2});
        } catch (DocumentException e) {
            e.printStackTrace();
        }
        PdfPCell cellOne = new PdfPCell(img);

        Font f=new Font(Font.FontFamily.TIMES_ROMAN,20.0f,Font.BOLD, BaseColor.BLACK);
        Font Para1_font=new Font(Font.FontFamily.TIMES_ROMAN,15.0f,Font.BOLD, BaseColor.BLACK);
        Paragraph paragraph1_header = new Paragraph("QUOTE TO: 294087",f);
        Paragraph paragraph = new Paragraph();
        paragraph.add("AAAAAAAAAALLC * hhjkhhhhuhjbbnb" +
                      "jgjkll;, Sjklkjjjhh * AAHHGBJJ");

       // Paragraph paragraph3 = new Paragraph();
       // paragraph3.add("Page 1");
        paragraph.setAlignment(Paragraph.ALIGN_LEFT);
        PdfPCell cellTwo = new PdfPCell(paragraph);
      //  PdfPCell cellThree = new PdfPCell(paragraph3);

        cellTwo.setPaddingLeft(10.0f);
        cellOne.setPaddingBottom(20.0f);
        cellTwo.setPaddingBottom(20.0f);
        cellThree.setPaddingBottom(20.0f);
        cellOne.setBorder(Rectangle.NO_BORDER);
        cellTwo.setBorder(Rectangle.NO_BORDER);
        cellThree.setBorder(Rectangle.NO_BORDER);
        cellOne.setHorizontalAlignment(Element.ALIGN_LEFT);
        cellTwo.setHorizontalAlignment(Element.ALIGN_LEFT);
        cellThree.setHorizontalAlignment(Element.ALIGN_RIGHT);
        table.addCell(cellOne);
        table.addCell(cellTwo);
        //table.addCell(cellThree);

        try {
            HeaderFooterPageEvent event = new HeaderFooterPageEvent(this, table);
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(path));
            //writer.setBoxSize("art", new Rectangle(36, 54, 559, 788));
            writer.setPageEvent(event);
            document.open();

inside HeaderFooterPageEvent class:

public void onOpenDocument(PdfWriter writer, Document document) {
    total = writer.getDirectContent().createTemplate(30, 16);
    try {
        totalPages = Image.getInstance(total);
    } catch (BadElementException e) {
        e.printStackTrace();
    }
    totalPages.setRole(PdfName.ARTIFACT);
}
public void onEndPage(PdfWriter writer, Document document) {

    footer.writeSelectedRows(0, -100, 36, 65, writer.getDirectContent());
    try {
        PdfPCell cell = new PdfPCell(Image.getInstance(total));
    } catch (BadElementException e) {
        e.printStackTrace();
    }

        Phrase footerPhrase = new Phrase("Page "+writer.getPageNumber()+
            " of");
    footerPhrase.add(new Chunk(totalPages,0,0,true));

        ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, footerPhrase, 500, 65, 0);

    }

Its just showing " Page x of" instead of " Page X of Y". Is there something I am missing? Please help.

Body:
You have implemented the onOpenDocument method to create a PdfTemplate of size 30, 16 (isn't that rather small?) and you are adding this empty placeholder on every page in the onEndPage method.

However, I don't see you adding content to the PdfTemplate anywhere. If you don't add the total number of pages, then you won't see the total number of pages anywhere in your document.

Since you can only know the total number of pages at the moment you close the document, you need to implement the onCloseDocument():

public void onCloseDocument(PdfWriter writer, Document document) {
    ColumnText.showTextAligned(total, Element.ALIGN_LEFT,
            new Phrase(String.valueOf(writer.getPageNumber() - 1)),
            2, 2, 0);
}

See MovieCountries1 for a full example. This example was written in the context of the second edition of the book "iText in Action."


问:
Offline Java Documentation
I've finally gotten around to learning Java and am looking for some documentation for Java that I can download and read offline. Something like Sun's stuff but zipped up or as a PDF or CHM.

I'm using Eclipse so something that integrates with that would be nice. It already seems to have some of what I want somewhere (the javadoc stuff) but I don't see how to search it and I'm not seeing a language ref.

答:
Read the JavaDocs. Especially the java.util.Collections framework. The core Java library is extremely well documented for the most part.

I also tend to browse the source to get a good understanding of how things work.  You should java the src.zip set up so you can browse inside JDK classes. It will also teach you good design; learn from the masters!

Some very useful commands to memorize in eclipse:

Ctrl-Shift-T
Open Type: search as you type a class name, select it to jump directly to it. You do not need to know the package, it searches all classes by their simple names.

F4
Open Type Hierarchy. With the cursor on any class reference in source or on a class in the package explorer, hitting F4 will open a type hierarchy.

Ctrl-T Quick type hierarchy. It's like F4 but opens a quick popup browser. Very convenient. My favorite use is to place it on an interface, and Ctrl-T will list all implementing classes.

OwnerDisplayName: BCS

Title: Offline Java Documentation

LastEditorDisplayName: Gamecat

OwnerDisplayName: tweakt


问:
How to hook up swagger-ui
I'm trying to hook in swagger-ui into a java dynamic web project. Currently, the rest api works and I am able to hit the following url and see the json: http://localhost:8080/test/swagger.json

My project uses Java, Swagger, Wildfly, and RestEasy.

```<code>public class SwaggerServlet extends HttpServlet {
    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);

        BeanConfig beanConfig = new BeanConfig();
        beanConfig.setVersion("1.0.0");
        beanConfig.setSchemes(new String[] { "http" });
        beanConfig.setHost("localhost:8080");
        beanConfig.setBasePath("/test");
        beanConfig.setResourcePackage("com.test.rest");
        beanConfig.setScan(true);
    }
}
</code>```

Following the tutorial found at this link: http://kjkrol.blogspot.ca/2015/01/how-to-integrate-swagger-ui-with-java.html to hook up swagger ui doesn't seem to work for me. I downloaded swagger-ui repo from github. I created a swagger folder in the following location:

my-project/src/main/webapp/swagger

In the swagger folder, copied the dist folder from the swagger-ui project. I also edited the URL as the tutorial suggests:

```<code>  // Build a system
  const ui = SwaggerUIBundle({
    url: "test/api-docs",
    dom_id: '#swagger-ui',
</code>```

答:
I ended up following an example found at this link: https://github.com/K0NRAD/swagger-wildfly-resteasy

It works! I noticed that the documentation takes a slightly different approach that for some reason wasn't working for me...

Thanks everyone!

Title: How to hook up swagger-ui

Body:
I'm trying to hook in swagger-ui into a java dynamic web project. Currently, the rest api works and I am able to hit the following url and see the json: http://localhost:8080/test/swagger.json

My project uses Java, Swagger, Wildfly, and RestEasy.

public class SwaggerServlet extends HttpServlet {
    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);

        BeanConfig beanConfig = new BeanConfig();
        beanConfig.setVersion("1.0.0");
        beanConfig.setSchemes(new String[] { "http" });
        beanConfig.setHost("localhost:8080");
        beanConfig.setBasePath("/test");
        beanConfig.setResourcePackage("com.test.rest");
        beanConfig.setScan(true);
    }
}

Following the tutorial found at this link: http://kjkrol.blogspot.ca/2015/01/how-to-integrate-swagger-ui-with-java.html to hook up swagger ui doesn't seem to work for me. I downloaded swagger-ui repo from github. I created a swagger folder in the following location:

my-project/src/main/webapp/swagger

In the swagger folder, copied the dist folder from the swagger-ui project. I also edited the URL as the tutorial suggests:

  // Build a system
  const ui = SwaggerUIBundle({
    url: "test/api-docs",
    dom_id: '#swagger-ui',


问:
Local libraries path removed from R path after minor upgrade
I have a lot of packages installed in ~/R/x86_64-pc-linux-gnu-library/3.4/. Today, I opened R, and attempted to run some code, and I found that packages were not being recognised:

Error in library("some_package"): there is no package called ‘some_package’

I looked at the paths, and I got this:

```<code>.libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library"
</code>```

which explains why packages are not longer recognised. Now, I know how to solve this (add local path to R paths, e.g. modifying /etc/R/Renviron).

Notice that I updated R via sudo apt-get update.... However, the update was minor (from 3.4 to 3.4.1) (so this is not a duplicate of this question). Here is the command line output of the update/upgrade. It seems the issue might have been related to the update of /etc/R/Renviron, as the line Replacing config file /etc/R/Renviron with new version indicates.

My packages source is

```<code>deb https://cloud.r-project.org/bin/linux/ubuntu xenial/
</code>```

My question is, why did this change happen? Does every minor change in R restores the paths to default? Is it somewhere explained in some documentation? I can't find a warning about it here or elsewhere.

答:
It's related to 3.4.1's new(?) default behaviour of making the same library of R packages available to all users on your Linux system. See here for a neat solution: https://stackoverflow.com/a/44903158/4115816

(The thread also describes some other options.)

Body:
I have a lot of packages installed in ~/R/x86_64-pc-linux-gnu-library/3.4/. Today, I opened R, and attempted to run some code, and I found that packages were not being recognised:

Error in library("some_package"): there is no package called ‘some_package’

I looked at the paths, and I got this:

.libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library"

which explains why packages are not longer recognised. Now, I know how to solve this (add local path to R paths, e.g. modifying /etc/R/Renviron).

Notice that I updated R via sudo apt-get update.... However, the update was minor (from 3.4 to 3.4.1) (so this is not a duplicate of this question). Here is the command line output of the update/upgrade. It seems the issue might have been related to the update of /etc/R/Renviron, as the line Replacing config file /etc/R/Renviron with new version indicates.

My packages source is

deb https://cloud.r-project.org/bin/linux/ubuntu xenial/

My question is, why did this change happen? Does every minor change in R restores the paths to default? Is it somewhere explained in some documentation? I can't find a warning about it here or elsewhere.


问:
ffmpeg - How to determine if -movflags faststart is enabled? PHP
While I am able to encode an mp4 file which I can play on my local windows machine, I am having trouble encoding files to mp4 which are readable when streaming by safari, etc.

After a bit of reading, I believe my issue is that I must move the metadata from the end of the file to the beginning in order for the converted mp4 files to  be streamable.

To that end, I am trying to find out if the build of ffmpeg that I am currently using is able to use the -movflags faststart option through php - as my current outputted mp4 files are not working when streamed online.

This is the way I am now echoing the -help, -formats, -codecs, but I am not seeing anything about -movflags faststart in any of the lists:

```<code>exec($ffmpegPath." -help", $codecArr);
for($ii=0;$ii<count($codecArr);$ii++){
    echo $codecArr[$ii].'</br>';
}
</code>```

Is there a similar method of determining if -movflags fastart is available to my ffmpeg build?  Any other way?  Should it be listed with any of the previously suggested commands? -help/-formats?

Can someone that knows it is enabled in their version of ffmpeg check to see if it is listed under -help or -formats, etc.?

TIA.

EDIT: COMPLETE CONSOLE OUTPUT FOR BOTH THE CONVERSION COMMAND AND -MOVFLAGS COMMAND BELOW:

COMMAND:

```<code>ffmpeg -i C:\vidtests\Wildlife.wmv -s 640x480 C:\vidtests\Wildlife.mp4
</code>```

OUTPUT:

```<code>ffmpeg version N-54207-ge59fb3f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 25 2013 21:55:00 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 17.100 / 55. 17.100
  libavformat    55. 10.100 / 55. 10.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[asf @ 00000000002ed760] Stream #0: not enough frames to estimate rate; consider
 increasing probesize
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, asf, from 'C:\vidtests\Wildlife.wmv'
:
  Metadata:
    SfOriginalFPS   : 299700
    WMFSDKVersion   : 11.0.6001.7000
    WMFSDKNeeded    : 0.0.0.0000
    comment         : Footage: Small World Productions, Inc; Tourism New Zealand
 | Producer: Gary F. Spradling | Music: Steve Ball
    title           : Wildlife in HD
    copyright       : ┬⌐ 2008 Microsoft Corporation
    IsVBR           : 0
    DeviceConformanceTemplate: AP@L3
  Duration: 00:00:30.09, start: 0.000000, bitrate: 6977 kb/s
    Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp
, 192 kb/s
    Stream #0:1(eng): Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, 1280x7
20, 5942 kb/s, 29.97 tbr, 1k tbn, 1k tbc
[libx264 @ 00000000002e6980] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64

[libx264 @ 00000000002e6980] profile High, level 3.0
[libx264 @ 00000000002e6980] 264 - core 133 r2334 a3ac64b - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'C:\vidtests\Wildlife.mp4':

  Metadata:
    SfOriginalFPS   : 299700
    WMFSDKVersion   : 11.0.6001.7000
    WMFSDKNeeded    : 0.0.0.0000
    comment         : Footage: Small World Productions, Inc; Tourism New Zealand
 | Producer: Gary F. Spradling | Music: Steve Ball
    title           : Wildlife in HD
    copyright       : ┬⌐ 2008 Microsoft Corporation
    IsVBR           : 0
    DeviceConformanceTemplate: AP@L3
    encoder         : Lavf55.10.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 6
40x480, q=-1--1, 30k tbn, 29.97 tbc
    Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100
Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (vc1 -> libx264)
  Stream #0:0 -> #0:1 (wmav2 -> libvo_aacenc)
Press [q] to stop, [?] for help
frame=   53 fps= 49 q=29.0 size=       0kB time=00:00:00.13 bitrate=   2.9kbits/
frame=   63 fps= 40 q=29.0 size=       0kB time=00:00:00.46 bitrate=   0.8kbits/
frame=   74 fps= 35 q=29.0 size=       0kB time=00:00:00.83 bitrate=   0.5kbits/
frame=   85 fps= 32 q=29.0 size=       0kB time=00:00:01.20 bitrate=   0.3kbits/
frame=   95 fps= 30 q=29.0 size=       0kB time=00:00:01.53 bitrate=   0.3kbits/
frame=  107 fps= 28 q=29.0 size=       0kB time=00:00:01.93 bitrate=   0.2kbits/
Queue input is backward in time
[mp4 @ 00000000003ef800] Non-monotonous DTS in output stream 0:1; previous: 7616
, current: 7063; changing to 7617. This may result in incorrect timestamps in th
e output file.
frame=  118 fps= 28 q=29.0 size=     113kB time=00:00:02.30 bitrate= 402.6kbits/
frame=  129 fps= 26 q=29.0 size=     219kB time=00:00:02.66 bitrate= 670.7kbits/
frame=  141 fps= 26 q=29.0 size=     264kB time=00:00:03.06 bitrate= 704.2kbits/
frame=  152 fps= 25 q=29.0 size=     328kB time=00:00:03.43 bitrate= 782.2kbits/
frame=  163 fps= 25 q=29.0 size=     431kB time=00:00:03.80 bitrate= 928.1kbits/
frame=  174 fps= 24 q=29.0 size=     568kB time=00:00:04.17 bitrate=1116.3kbits/
frame=  190 fps= 25 q=29.0 size=     781kB time=00:00:04.70 bitrate=1359.9kbits/
frame=  204 fps= 25 q=29.0 size=    1006kB time=00:00:05.17 bitrate=1593.1kbits/
frame=  218 fps= 25 q=29.0 size=    1058kB time=00:00:05.63 bitrate=1536.8kbits/
frame=  229 fps= 25 q=29.0 size=    1093kB time=00:00:06.00 bitrate=1490.9kbits/
frame=  239 fps= 24 q=29.0 size=    1118kB time=00:00:06.33 bitrate=1444.4kbits/
frame=  251 fps= 24 q=29.0 size=    1150kB time=00:00:06.74 bitrate=1397.9kbits/
frame=  265 fps= 24 q=29.0 size=    1234kB time=00:00:07.20 bitrate=1402.3kbits/
frame=  278 fps= 25 q=29.0 size=    1332kB time=00:00:07.64 bitrate=1428.3kbits/
frame=  294 fps= 25 q=29.0 size=    1403kB time=00:00:08.17 bitrate=1405.7kbits/
frame=  308 fps= 25 q=29.0 size=    1547kB time=00:00:08.64 bitrate=1466.4kbits/
frame=  323 fps= 25 q=29.0 size=    1595kB time=00:00:09.14 bitrate=1429.5kbits/
frame=  337 fps= 25 q=29.0 size=    1702kB time=00:00:09.60 bitrate=1450.7kbits/
frame=  351 fps= 25 q=29.0 size=    1755kB time=00:00:10.07 bitrate=1427.1kbits/
frame=  365 fps= 25 q=29.0 size=    1820kB time=00:00:10.54 bitrate=1414.1kbits/
frame=  381 fps= 25 q=29.0 size=    1852kB time=00:00:11.07 bitrate=1369.6kbits/
frame=  396 fps= 26 q=29.0 size=    1893kB time=00:00:11.57 bitrate=1339.5kbits/
frame=  409 fps= 26 q=29.0 size=    1923kB time=00:00:12.01 bitrate=1311.8kbits/
frame=  421 fps= 25 q=29.0 size=    1967kB time=00:00:12.41 bitrate=1298.3kbits/
frame=  434 fps= 25 q=29.0 size=    1998kB time=00:00:12.84 bitrate=1274.0kbits/
frame=  445 fps= 25 q=29.0 size=    2018kB time=00:00:13.21 bitrate=1251.3kbits/
frame=  458 fps= 25 q=29.0 size=    2048kB time=00:00:13.64 bitrate=1229.5kbits/
frame=  471 fps= 25 q=29.0 size=    2067kB time=00:00:14.08 bitrate=1202.3kbits/
frame=  484 fps= 25 q=29.0 size=    2189kB time=00:00:14.51 bitrate=1235.5kbits/
frame=  497 fps= 25 q=29.0 size=    2260kB time=00:00:14.94 bitrate=1238.3kbits/
frame=  509 fps= 25 q=29.0 size=    2311kB time=00:00:15.34 bitrate=1233.3kbits/
frame=  523 fps= 25 q=29.0 size=    2429kB time=00:00:15.81 bitrate=1258.1kbits/
frame=  535 fps= 25 q=29.0 size=    2541kB time=00:00:16.21 bitrate=1283.5kbits/
frame=  548 fps= 25 q=29.0 size=    2718kB time=00:00:16.64 bitrate=1337.5kbits/
frame=  560 fps= 25 q=29.0 size=    2845kB time=00:00:17.05 bitrate=1367.1kbits/
frame=  571 fps= 25 q=29.0 size=    2965kB time=00:00:17.41 bitrate=1394.6kbits/
frame=  580 fps= 25 q=29.0 size=    3025kB time=00:00:17.71 bitrate=1398.7kbits/
frame=  588 fps= 25 q=29.0 size=    3098kB time=00:00:17.98 bitrate=1411.1kbits/
frame=  597 fps= 25 q=29.0 size=    3183kB time=00:00:18.28 bitrate=1426.1kbits/
frame=  606 fps= 24 q=29.0 size=    3279kB time=00:00:18.58 bitrate=1445.2kbits/
frame=  616 fps= 24 q=29.0 size=    3441kB time=00:00:18.91 bitrate=1489.9kbits/
frame=  626 fps= 24 q=29.0 size=    3650kB time=00:00:19.25 bitrate=1553.0kbits/
frame=  638 fps= 24 q=29.0 size=    3826kB time=00:00:19.65 bitrate=1594.7kbits/
frame=  649 fps= 24 q=29.0 size=    3950kB time=00:00:20.02 bitrate=1616.3kbits/
frame=  660 fps= 24 q=29.0 size=    4067kB time=00:00:20.38 bitrate=1634.1kbits/
frame=  669 fps= 24 q=29.0 size=    4121kB time=00:00:20.68 bitrate=1631.8kbits/
frame=  682 fps= 24 q=29.0 size=    4274kB time=00:00:21.12 bitrate=1657.9kbits/
frame=  696 fps= 24 q=29.0 size=    4446kB time=00:00:21.58 bitrate=1687.1kbits/
frame=  709 fps= 24 q=29.0 size=    4590kB time=00:00:22.02 bitrate=1707.3kbits/
frame=  719 fps= 24 q=29.0 size=    4772kB time=00:00:22.35 bitrate=1748.5kbits/
frame=  732 fps= 24 q=29.0 size=    4852kB time=00:00:22.78 bitrate=1744.3kbits/
frame=  744 fps= 24 q=29.0 size=    4973kB time=00:00:23.18 bitrate=1756.9kbits/
frame=  756 fps= 24 q=29.0 size=    5099kB time=00:00:23.59 bitrate=1770.8kbits/
frame=  768 fps= 24 q=29.0 size=    5149kB time=00:00:23.99 bitrate=1758.4kbits/
frame=  780 fps= 24 q=29.0 size=    5227kB time=00:00:24.39 bitrate=1755.7kbits/
frame=  797 fps= 24 q=29.0 size=    5377kB time=00:00:24.95 bitrate=1765.0kbits/
frame=  813 fps= 24 q=29.0 size=    5507kB time=00:00:25.49 bitrate=1769.5kbits/
frame=  828 fps= 24 q=29.0 size=    5634kB time=00:00:25.99 bitrate=1775.5kbits/
frame=  843 fps= 24 q=29.0 size=    5701kB time=00:00:26.49 bitrate=1762.9kbits/
frame=  859 fps= 24 q=29.0 size=    5830kB time=00:00:27.02 bitrate=1767.0kbits/
frame=  872 fps= 24 q=29.0 size=    5926kB time=00:00:27.46 bitrate=1767.7kbits/
frame=  888 fps= 24 q=29.0 size=    6014kB time=00:00:27.99 bitrate=1759.7kbits/
frame=  900 fps= 24 q=29.0 size=    6332kB time=00:00:28.39 bitrate=1826.9kbits/
frame=  901 fps= 24 q=-1.0 Lsize=    6717kB time=00:00:30.10 bitrate=1828.0kbits
/s
video:6211kB audio:472kB subtitle:0 global headers:0kB muxing overhead 0.513217%

[libx264 @ 00000000002e6980] frame I:8     Avg QP:21.77  size: 39744
[libx264 @ 00000000002e6980] frame P:433   Avg QP:25.69  size: 11490
[libx264 @ 00000000002e6980] frame B:460   Avg QP:29.25  size:  2319
[libx264 @ 00000000002e6980] consecutive B-frames:  5.4% 78.6%  2.7% 13.3%
[libx264 @ 00000000002e6980] mb I  I16..4: 21.8% 48.8% 29.5%
[libx264 @ 00000000002e6980] mb P  I16..4:  0.7%  4.0%  1.3%  P16..4: 37.1% 22.2
% 15.5%  0.0%  0.0%    skip:19.2%
[libx264 @ 00000000002e6980] mb B  I16..4:  0.1%  0.5%  0.2%  B16..8: 43.5%  7.0
%  2.1%  direct: 2.2%  skip:44.5%  L0:36.4% L1:52.7% BI:10.9%
[libx264 @ 00000000002e6980] 8x8 transform intra:62.8% inter:56.2%
[libx264 @ 00000000002e6980] coded y,uvDC,uvAC intra: 74.2% 78.8% 44.0% inter: 2
3.6% 14.5% 1.0%
[libx264 @ 00000000002e6980] i16 v,h,dc,p: 48% 24%  9% 20%
[libx264 @ 00000000002e6980] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 17% 15%  7%  8%
11%  8% 10%  8%
[libx264 @ 00000000002e6980] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 17% 15%  7% 10%
11%  8%  7%  7%
[libx264 @ 00000000002e6980] i8c dc,h,v,p: 53% 21% 18%  7%
[libx264 @ 00000000002e6980] Weighted P-Frames: Y:0.7% UV:0.0%
[libx264 @ 00000000002e6980] ref P L0: 62.4% 19.0% 12.0%  6.6%  0.0%
[libx264 @ 00000000002e6980] ref B L0: 90.5%  8.9%  0.7%
[libx264 @ 00000000002e6980] ref B L1: 97.9%  2.1%
[libx264 @ 00000000002e6980] kb/s:1692.37
</code>```

AND THE –MOVFLAGS COMMAND:

```<code>ffmpeg -i C:\vidtests\Wildlife.mp4 -movflags faststart C:\vidtests\Wildlife_fs.mp4
</code>```

AND THE –MOVFLAGS OUTPUT

```<code>ffmpeg version N-54207-ge59fb3f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 25 2013 21:55:00 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 17.100 / 55. 17.100
  libavformat    55. 10.100 / 55. 10.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\vidtests\Wildlife.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Wildlife in HD
    encoder         : Lavf55.10.100
    comment         : Footage: Small World Productions, Inc; Tourism New Zealand
 | Producer: Gary F. Spradling | Music: Steve Ball
    copyright       : ┬⌐ 2008 Microsoft Corporation
  Duration: 00:00:30.13, start: 0.036281, bitrate: 1826 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480,
1692 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 12
8 kb/s
    Metadata:
      handler_name    : SoundHandler
[libx264 @ 0000000004360620] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64

[libx264 @ 0000000004360620] profile High, level 3.0
[libx264 @ 0000000004360620] 264 - core 133 r2334 a3ac64b - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'C:\vidtests\Wildlife_fs.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Wildlife in HD
    copyright       : ┬⌐ 2008 Microsoft Corporation
    comment         : Footage: Small World Productions, Inc; Tourism New Zealand
 | Producer: Gary F. Spradling | Music: Steve Ball
    encoder         : Lavf55.10.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 6
40x480, q=-1--1, 30k tbn, 29.97 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100
Hz, stereo, s16, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> libvo_aacenc)
Press [q] to stop, [?] for help
frame=   52 fps=0.0 q=29.0 size=      29kB time=00:00:01.76 bitrate= 133.9kbits/
frame=   63 fps= 60 q=29.0 size=     104kB time=00:00:02.14 bitrate= 397.2kbits/
frame=   74 fps= 47 q=29.0 size=     176kB time=00:00:02.51 bitrate= 573.2kbits/
frame=   87 fps= 41 q=29.0 size=     265kB time=00:00:02.93 bitrate= 741.2kbits/
frame=  101 fps= 37 q=29.0 size=     358kB time=00:00:03.39 bitrate= 862.8kbits/
frame=  113 fps= 34 q=29.0 size=     437kB time=00:00:03.79 bitrate= 943.7kbits/
frame=  125 fps= 33 q=29.0 size=     520kB time=00:00:04.20 bitrate=1012.2kbits/
frame=  138 fps= 32 q=29.0 size=     606kB time=00:00:04.64 bitrate=1069.8kbits/
frame=  151 fps= 31 q=29.0 size=     696kB time=00:00:05.06 bitrate=1124.3kbits/
frame=  163 fps= 30 q=29.0 size=     780kB time=00:00:05.47 bitrate=1166.4kbits/
frame=  176 fps= 30 q=29.0 size=     919kB time=00:00:05.90 bitrate=1273.9kbits/
frame=  196 fps= 31 q=29.0 size=     994kB time=00:00:06.57 bitrate=1237.4kbits/
frame=  213 fps= 31 q=29.0 size=    1097kB time=00:00:07.13 bitrate=1258.8kbits/
frame=  225 fps= 30 q=29.0 size=    1204kB time=00:00:07.53 bitrate=1309.8kbits/
frame=  236 fps= 30 q=29.0 size=    1323kB time=00:00:07.91 bitrate=1369.4kbits/
frame=  249 fps= 29 q=29.0 size=    1451kB time=00:00:08.34 bitrate=1424.6kbits/
frame=  263 fps= 29 q=29.0 size=    1574kB time=00:00:08.82 bitrate=1461.3kbits/
frame=  278 fps= 29 q=29.0 size=    1610kB time=00:00:09.30 bitrate=1416.9kbits/
frame=  296 fps= 30 q=29.0 size=    1655kB time=00:00:09.91 bitrate=1368.0kbits/
frame=  313 fps= 30 q=29.0 size=    1697kB time=00:00:10.48 bitrate=1326.4kbits/
frame=  330 fps= 30 q=29.0 size=    1737kB time=00:00:11.05 bitrate=1286.5kbits/
frame=  345 fps= 30 q=29.0 size=    1776kB time=00:00:11.54 bitrate=1260.4kbits/
frame=  361 fps= 30 q=29.0 size=    1813kB time=00:00:12.07 bitrate=1230.3kbits/
frame=  377 fps= 30 q=29.0 size=    1847kB time=00:00:12.59 bitrate=1201.4kbits/
frame=  395 fps= 30 q=29.0 size=    1880kB time=00:00:13.22 bitrate=1165.0kbits/
frame=  410 fps= 30 q=29.0 size=    1993kB time=00:00:13.72 bitrate=1190.2kbits/
frame=  424 fps= 30 q=29.0 size=    2080kB time=00:00:14.18 bitrate=1201.4kbits/
frame=  439 fps= 30 q=29.0 size=    2166kB time=00:00:14.67 bitrate=1209.4kbits/
frame=  455 fps= 30 q=29.0 size=    2262kB time=00:00:15.21 bitrate=1217.5kbits/
frame=  469 fps= 30 q=29.0 size=    2341kB time=00:00:15.68 bitrate=1223.0kbits/
frame=  484 fps= 30 q=29.0 size=    2430kB time=00:00:16.19 bitrate=1229.1kbits/
frame=  500 fps= 30 q=29.0 size=    2523kB time=00:00:16.71 bitrate=1236.3kbits/
frame=  515 fps= 30 q=29.0 size=    2607kB time=00:00:17.21 bitrate=1240.4kbits/
frame=  531 fps= 30 q=29.0 size=    2681kB time=00:00:17.73 bitrate=1238.2kbits/
frame=  546 fps= 30 q=29.0 size=    2758kB time=00:00:18.24 bitrate=1238.2kbits/
frame=  561 fps= 30 q=29.0 size=    2824kB time=00:00:18.75 bitrate=1233.4kbits/
frame=  576 fps= 30 q=29.0 size=    2955kB time=00:00:19.25 bitrate=1256.8kbits/
frame=  586 fps= 29 q=29.0 size=    3061kB time=00:00:19.59 bitrate=1279.6kbits/
frame=  598 fps= 29 q=29.0 size=    3217kB time=00:00:19.99 bitrate=1318.4kbits/
frame=  610 fps= 29 q=29.0 size=    3354kB time=00:00:20.39 bitrate=1347.2kbits/
frame=  622 fps= 29 q=29.0 size=    3483kB time=00:00:20.78 bitrate=1372.6kbits/
frame=  634 fps= 29 q=29.0 size=    3593kB time=00:00:21.19 bitrate=1388.6kbits/
frame=  648 fps= 29 q=29.0 size=    3708kB time=00:00:21.66 bitrate=1402.3kbits/
frame=  661 fps= 29 q=29.0 size=    3811kB time=00:00:22.08 bitrate=1413.5kbits/
frame=  674 fps= 29 q=29.0 size=    3978kB time=00:00:22.53 bitrate=1446.3kbits/
frame=  690 fps= 29 q=29.0 size=    4133kB time=00:00:23.05 bitrate=1468.4kbits/
frame=  706 fps= 29 q=29.0 size=    4263kB time=00:00:23.58 bitrate=1480.4kbits/
frame=  721 fps= 29 q=29.0 size=    4391kB time=00:00:24.08 bitrate=1493.8kbits/
frame=  735 fps= 29 q=29.0 size=    4524kB time=00:00:24.55 bitrate=1509.4kbits/
frame=  748 fps= 29 q=29.0 size=    4661kB time=00:00:24.98 bitrate=1528.2kbits/
frame=  763 fps= 29 q=29.0 size=    4835kB time=00:00:25.50 bitrate=1553.1kbits/
frame=  778 fps= 29 q=29.0 size=    4993kB time=00:00:25.99 bitrate=1573.6kbits/
frame=  795 fps= 29 q=29.0 size=    5149kB time=00:00:26.56 bitrate=1588.1kbits/
frame=  814 fps= 29 q=29.0 size=    5258kB time=00:00:27.18 bitrate=1584.4kbits/
frame=  833 fps= 29 q=29.0 size=    5368kB time=00:00:27.82 bitrate=1580.2kbits/
frame=  851 fps= 29 q=29.0 size=    5469kB time=00:00:28.43 bitrate=1575.9kbits/
frame=  870 fps= 29 q=29.0 size=    5567kB time=00:00:29.05 bitrate=1569.5kbits/
frame=  889 fps= 29 q=29.0 size=    5688kB time=00:00:29.70 bitrate=1568.4kbits/
Starting second pass: moving header on top of the file
frame=  902 fps= 28 q=-1.0 Lsize=    6109kB time=00:00:30.14 bitrate=1659.8kbits
/s dup=1 drop=0
video:5602kB audio:472kB subtitle:0 global headers:0kB muxing overhead 0.566600%

[libx264 @ 0000000004360620] frame I:8     Avg QP:20.52  size: 39667
[libx264 @ 0000000004360620] frame P:419   Avg QP:25.06  size: 10524
[libx264 @ 0000000004360620] frame B:475   Avg QP:29.03  size:  2123
[libx264 @ 0000000004360620] consecutive B-frames:  3.2% 79.6%  0.3% 16.9%
[libx264 @ 0000000004360620] mb I  I16..4: 20.7% 52.3% 26.9%
[libx264 @ 0000000004360620] mb P  I16..4:  0.7%  4.2%  1.1%  P16..4: 39.4% 21.4
% 13.8%  0.0%  0.0%    skip:19.3%
[libx264 @ 0000000004360620] mb B  I16..4:  0.1%  0.9%  0.3%  B16..8: 41.8%  6.4
%  1.7%  direct: 1.7%  skip:47.1%  L0:36.4% L1:53.3% BI:10.3%
[libx264 @ 0000000004360620] 8x8 transform intra:65.7% inter:58.8%
[libx264 @ 0000000004360620] coded y,uvDC,uvAC intra: 71.2% 76.6% 35.7% inter: 2
0.7% 13.0% 0.5%
[libx264 @ 0000000004360620] i16 v,h,dc,p: 48% 24%  8% 20%
[libx264 @ 0000000004360620] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 18% 15%  6%  8%
11%  8% 10%  8%
[libx264 @ 0000000004360620] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 16% 15%  7% 10%
11%  8%  8%  7%
[libx264 @ 0000000004360620] i8c dc,h,v,p: 51% 22% 19%  9%
[libx264 @ 0000000004360620] Weighted P-Frames: Y:0.7% UV:0.0%
[libx264 @ 0000000004360620] ref P L0: 63.4% 19.7% 11.0%  5.9%  0.0%
[libx264 @ 0000000004360620] ref B L0: 90.7%  8.7%  0.7%
[libx264 @ 0000000004360620] ref B L1: 98.4%  1.6%
[libx264 @ 0000000004360620] kb/s:1524.54
</code>```

答:
You can use AtomicParsley, AtomicParsley input.mp4 -T .I found the way to check it in this post and it work perfect!!
Here the full soluction: https://superuser.com/questions/559372/using-ffmpeg-to-locate-moov-atom.

Body:
While I am able to encode an mp4 file which I can play on my local windows machine, I am having trouble encoding files to mp4 which are readable when streaming by safari, etc.

After a bit of reading, I believe my issue is that I must move the metadata from the end of the file to the beginning in order for the converted mp4 files to  be streamable.

To that end, I am trying to find out if the build of ffmpeg that I am currently using is able to use the -movflags faststart option through php - as my current outputted mp4 files are not working when streamed online.

This is the way I am now echoing the -help, -formats, -codecs, but I am not seeing anything about -movflags faststart in any of the lists:

exec($ffmpegPath." -help", $codecArr);
for($ii=0;$ii<count($codecArr);$ii++){
    echo $codecArr[$ii].'
';
}

Is there a similar method of determining if -movflags fastart is available to my ffmpeg build?  Any other way?  Should it be listed with any of the previously suggested commands? -help/-formats?

Can someone that knows it is enabled in their version of ffmpeg check to see if it is listed under -help or -formats, etc.?

TIA.

EDIT: COMPLETE CONSOLE OUTPUT FOR BOTH THE CONVERSION COMMAND AND -MOVFLAGS COMMAND BELOW:

COMMAND:

ffmpeg -i C:\vidtests\Wildlife.wmv -s 640x480 C:\vidtests\Wildlife.mp4

OUTPUT:

ffmpeg version N-54207-ge59fb3f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 25 2013 21:55:00 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 17.100 / 55. 17.100
  libavformat    55. 10.100 / 55. 10.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[asf @ 00000000002ed760] Stream #0: not enough frames to estimate rate; consider
 increasing probesize
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, asf, from 'C:\vidtests\Wildlife.wmv'
:
  Metadata:
    SfOriginalFPS   : 299700
    WMFSDKVersion   : 11.0.6001.7000
    WMFSDKNeeded    : 0.0.0.0000
    comment         : Footage: Small World Productions, Inc; Tourism New Zealand
 | Producer: Gary F. Spradling | Music: Steve Ball
    title           : Wildlife in HD
    copyright       : ┬⌐ 2008 Microsoft Corporation
    IsVBR           : 0
    DeviceConformanceTemplate: AP@L3
  Duration: 00:00:30.09, start: 0.000000, bitrate: 6977 kb/s
    Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp
, 192 kb/s
    Stream #0:1(eng): Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, 1280x7
20, 5942 kb/s, 29.97 tbr, 1k tbn, 1k tbc
[libx264 @ 00000000002e6980] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64

[libx264 @ 00000000002e6980] profile High, level 3.0
[libx264 @ 00000000002e6980] 264 - core 133 r2334 a3ac64b - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'C:\vidtests\Wildlife.mp4':

  Metadata:
    SfOriginalFPS   : 299700
    WMFSDKVersion   : 11.0.6001.7000
    WMFSDKNeeded    : 0.0.0.0000
    comment         : Footage: Small World Productions, Inc; Tourism New Zealand
 | Producer: Gary F. Spradling | Music: Steve Ball
    title           : Wildlife in HD
    copyright       : ┬⌐ 2008 Microsoft Corporation
    IsVBR           : 0
    DeviceConformanceTemplate: AP@L3
    encoder         : Lavf55.10.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 6
40x480, q=-1--1, 30k tbn, 29.97 tbc
    Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100
Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (vc1 -> libx264)
  Stream #0:0 -> #0:1 (wmav2 -> libvo_aacenc)
Press [q] to stop, [?] for help
frame=   53 fps= 49 q=29.0 size=       0kB time=00:00:00.13 bitrate=   2.9kbits/
frame=   63 fps= 40 q=29.0 size=       0kB time=00:00:00.46 bitrate=   0.8kbits/
frame=   74 fps= 35 q=29.0 size=       0kB time=00:00:00.83 bitrate=   0.5kbits/
frame=   85 fps= 32 q=29.0 size=       0kB time=00:00:01.20 bitrate=   0.3kbits/
frame=   95 fps= 30 q=29.0 size=       0kB time=00:00:01.53 bitrate=   0.3kbits/
frame=  107 fps= 28 q=29.0 size=       0kB time=00:00:01.93 bitrate=   0.2kbits/
Queue input is backward in time
[mp4 @ 00000000003ef800] Non-monotonous DTS in output stream 0:1; previous: 7616
, current: 7063; changing to 7617. This may result in incorrect timestamps in th
e output file.
frame=  118 fps= 28 q=29.0 size=     113kB time=00:00:02.30 bitrate= 402.6kbits/
frame=  129 fps= 26 q=29.0 size=     219kB time=00:00:02.66 bitrate= 670.7kbits/
frame=  141 fps= 26 q=29.0 size=     264kB time=00:00:03.06 bitrate= 704.2kbits/
frame=  152 fps= 25 q=29.0 size=     328kB time=00:00:03.43 bitrate= 782.2kbits/
frame=  163 fps= 25 q=29.0 size=     431kB time=00:00:03.80 bitrate= 928.1kbits/
frame=  174 fps= 24 q=29.0 size=     568kB time=00:00:04.17 bitrate=1116.3kbits/
frame=  190 fps= 25 q=29.0 size=     781kB time=00:00:04.70 bitrate=1359.9kbits/
frame=  204 fps= 25 q=29.0 size=    1006kB time=00:00:05.17 bitrate=1593.1kbits/
frame=  218 fps= 25 q=29.0 size=    1058kB time=00:00:05.63 bitrate=1536.8kbits/
frame=  229 fps= 25 q=29.0 size=    1093kB time=00:00:06.00 bitrate=1490.9kbits/
frame=  239 fps= 24 q=29.0 size=    1118kB time=00:00:06.33 bitrate=1444.4kbits/
frame=  251 fps= 24 q=29.0 size=    1150kB time=00:00:06.74 bitrate=1397.9kbits/
frame=  265 fps= 24 q=29.0 size=    1234kB time=00:00:07.20 bitrate=1402.3kbits/
frame=  278 fps= 25 q=29.0 size=    1332kB time=00:00:07.64 bitrate=1428.3kbits/
frame=  294 fps= 25 q=29.0 size=    1403kB time=00:00:08.17 bitrate=1405.7kbits/
frame=  308 fps= 25 q=29.0 size=    1547kB time=00:00:08.64 bitrate=1466.4kbits/
frame=  323 fps= 25 q=29.0 size=    1595kB time=00:00:09.14 bitrate=1429.5kbits/
frame=  337 fps= 25 q=29.0 size=    1702kB time=00:00:09.60 bitrate=1450.7kbits/
frame=  351 fps= 25 q=29.0 size=    1755kB time=00:00:10.07 bitrate=1427.1kbits/
frame=  365 fps= 25 q=29.0 size=    1820kB time=00:00:10.54 bitrate=1414.1kbits/
frame=  381 fps= 25 q=29.0 size=    1852kB time=00:00:11.07 bitrate=1369.6kbits/
frame=  396 fps= 26 q=29.0 size=    1893kB time=00:00:11.57 bitrate=1339.5kbits/
frame=  409 fps= 26 q=29.0 size=    1923kB time=00:00:12.01 bitrate=1311.8kbits/
frame=  421 fps= 25 q=29.0 size=    1967kB time=00:00:12.41 bitrate=1298.3kbits/
frame=  434 fps= 25 q=29.0 size=    1998kB time=00:00:12.84 bitrate=1274.0kbits/
frame=  445 fps= 25 q=29.0 size=    2018kB time=00:00:13.21 bitrate=1251.3kbits/
frame=  458 fps= 25 q=29.0 size=    2048kB time=00:00:13.64 bitrate=1229.5kbits/
frame=  471 fps= 25 q=29.0 size=    2067kB time=00:00:14.08 bitrate=1202.3kbits/
frame=  484 fps= 25 q=29.0 size=    2189kB time=00:00:14.51 bitrate=1235.5kbits/
frame=  497 fps= 25 q=29.0 size=    2260kB time=00:00:14.94 bitrate=1238.3kbits/
frame=  509 fps= 25 q=29.0 size=    2311kB time=00:00:15.34 bitrate=1233.3kbits/
frame=  523 fps= 25 q=29.0 size=    2429kB time=00:00:15.81 bitrate=1258.1kbits/
frame=  535 fps= 25 q=29.0 size=    2541kB time=00:00:16.21 bitrate=1283.5kbits/
frame=  548 fps= 25 q=29.0 size=    2718kB time=00:00:16.64 bitrate=1337.5kbits/
frame=  560 fps= 25 q=29.0 size=    2845kB time=00:00:17.05 bitrate=1367.1kbits/
frame=  571 fps= 25 q=29.0 size=    2965kB time=00:00:17.41 bitrate=1394.6kbits/
frame=  580 fps= 25 q=29.0 size=    3025kB time=00:00:17.71 bitrate=1398.7kbits/
frame=  588 fps= 25 q=29.0 size=    3098kB time=00:00:17.98 bitrate=1411.1kbits/
frame=  597 fps= 25 q=29.0 size=    3183kB time=00:00:18.28 bitrate=1426.1kbits/
frame=  606 fps= 24 q=29.0 size=    3279kB time=00:00:18.58 bitrate=1445.2kbits/
frame=  616 fps= 24 q=29.0 size=    3441kB time=00:00:18.91 bitrate=1489.9kbits/
frame=  626 fps= 24 q=29.0 size=    3650kB time=00:00:19.25 bitrate=1553.0kbits/
frame=  638 fps= 24 q=29.0 size=    3826kB time=00:00:19.65 bitrate=1594.7kbits/
frame=  649 fps= 24 q=29.0 size=    3950kB time=00:00:20.02 bitrate=1616.3kbits/
frame=  660 fps= 24 q=29.0 size=    4067kB time=00:00:20.38 bitrate=1634.1kbits/
frame=  669 fps= 24 q=29.0 size=    4121kB time=00:00:20.68 bitrate=1631.8kbits/
frame=  682 fps= 24 q=29.0 size=    4274kB time=00:00:21.12 bitrate=1657.9kbits/
frame=  696 fps= 24 q=29.0 size=    4446kB time=00:00:21.58 bitrate=1687.1kbits/
frame=  709 fps= 24 q=29.0 size=    4590kB time=00:00:22.02 bitrate=1707.3kbits/
frame=  719 fps= 24 q=29.0 size=    4772kB time=00:00:22.35 bitrate=1748.5kbits/
frame=  732 fps= 24 q=29.0 size=    4852kB time=00:00:22.78 bitrate=1744.3kbits/
frame=  744 fps= 24 q=29.0 size=    4973kB time=00:00:23.18 bitrate=1756.9kbits/
frame=  756 fps= 24 q=29.0 size=    5099kB time=00:00:23.59 bitrate=1770.8kbits/
frame=  768 fps= 24 q=29.0 size=    5149kB time=00:00:23.99 bitrate=1758.4kbits/
frame=  780 fps= 24 q=29.0 size=    5227kB time=00:00:24.39 bitrate=1755.7kbits/
frame=  797 fps= 24 q=29.0 size=    5377kB time=00:00:24.95 bitrate=1765.0kbits/
frame=  813 fps= 24 q=29.0 size=    5507kB time=00:00:25.49 bitrate=1769.5kbits/
frame=  828 fps= 24 q=29.0 size=    5634kB time=00:00:25.99 bitrate=1775.5kbits/
frame=  843 fps= 24 q=29.0 size=    5701kB time=00:00:26.49 bitrate=1762.9kbits/
frame=  859 fps= 24 q=29.0 size=    5830kB time=00:00:27.02 bitrate=1767.0kbits/
frame=  872 fps= 24 q=29.0 size=    5926kB time=00:00:27.46 bitrate=1767.7kbits/
frame=  888 fps= 24 q=29.0 size=    6014kB time=00:00:27.99 bitrate=1759.7kbits/
frame=  900 fps= 24 q=29.0 size=    6332kB time=00:00:28.39 bitrate=1826.9kbits/
frame=  901 fps= 24 q=-1.0 Lsize=    6717kB time=00:00:30.10 bitrate=1828.0kbits
/s
video:6211kB audio:472kB subtitle:0 global headers:0kB muxing overhead 0.513217%

[libx264 @ 00000000002e6980] frame I:8     Avg QP:21.77  size: 39744
[libx264 @ 00000000002e6980] frame P:433   Avg QP:25.69  size: 11490
[libx264 @ 00000000002e6980] frame B:460   Avg QP:29.25  size:  2319
[libx264 @ 00000000002e6980] consecutive B-frames:  5.4% 78.6%  2.7% 13.3%
[libx264 @ 00000000002e6980] mb I  I16..4: 21.8% 48.8% 29.5%
[libx264 @ 00000000002e6980] mb P  I16..4:  0.7%  4.0%  1.3%  P16..4: 37.1% 22.2
% 15.5%  0.0%  0.0%    skip:19.2%
[libx264 @ 00000000002e6980] mb B  I16..4:  0.1%  0.5%  0.2%  B16..8: 43.5%  7.0
%  2.1%  direct: 2.2%  skip:44.5%  L0:36.4% L1:52.7% BI:10.9%
[libx264 @ 00000000002e6980] 8x8 transform intra:62.8% inter:56.2%
[libx264 @ 00000000002e6980] coded y,uvDC,uvAC intra: 74.2% 78.8% 44.0% inter: 2
3.6% 14.5% 1.0%
[libx264 @ 00000000002e6980] i16 v,h,dc,p: 48% 24%  9% 20%
[libx264 @ 00000000002e6980] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 17% 15%  7%  8%
11%  8% 10%  8%
[libx264 @ 00000000002e6980] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 17% 15%  7% 10%
11%  8%  7%  7%
[libx264 @ 00000000002e6980] i8c dc,h,v,p: 53% 21% 18%  7%
[libx264 @ 00000000002e6980] Weighted P-Frames: Y:0.7% UV:0.0%
[libx264 @ 00000000002e6980] ref P L0: 62.4% 19.0% 12.0%  6.6%  0.0%
[libx264 @ 00000000002e6980] ref B L0: 90.5%  8.9%  0.7%
[libx264 @ 00000000002e6980] ref B L1: 97.9%  2.1%
[libx264 @ 00000000002e6980] kb/s:1692.37

AND THE –MOVFLAGS COMMAND:

ffmpeg -i C:\vidtests\Wildlife.mp4 -movflags faststart C:\vidtests\Wildlife_fs.mp4

AND THE –MOVFLAGS OUTPUT

ffmpeg version N-54207-ge59fb3f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 25 2013 21:55:00 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 17.100 / 55. 17.100
  libavformat    55. 10.100 / 55. 10.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\vidtests\Wildlife.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Wildlife in HD
    encoder         : Lavf55.10.100
    comment         : Footage: Small World Productions, Inc; Tourism New Zealand
 | Producer: Gary F. Spradling | Music: Steve Ball
    copyright       : ┬⌐ 2008 Microsoft Corporation
  Duration: 00:00:30.13, start: 0.036281, bitrate: 1826 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480,
1692 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 12
8 kb/s
    Metadata:
      handler_name    : SoundHandler
[libx264 @ 0000000004360620] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64

[libx264 @ 0000000004360620] profile High, level 3.0
[libx264 @ 0000000004360620] 264 - core 133 r2334 a3ac64b - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'C:\vidtests\Wildlife_fs.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Wildlife in HD
    copyright       : ┬⌐ 2008 Microsoft Corporation
    comment         : Footage: Small World Productions, Inc; Tourism New Zealand
 | Producer: Gary F. Spradling | Music: Steve Ball
    encoder         : Lavf55.10.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 6
40x480, q=-1--1, 30k tbn, 29.97 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100
Hz, stereo, s16, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> libvo_aacenc)
Press [q] to stop, [?] for help
frame=   52 fps=0.0 q=29.0 size=      29kB time=00:00:01.76 bitrate= 133.9kbits/
frame=   63 fps= 60 q=29.0 size=     104kB time=00:00:02.14 bitrate= 397.2kbits/
frame=   74 fps= 47 q=29.0 size=     176kB time=00:00:02.51 bitrate= 573.2kbits/
frame=   87 fps= 41 q=29.0 size=     265kB time=00:00:02.93 bitrate= 741.2kbits/
frame=  101 fps= 37 q=29.0 size=     358kB time=00:00:03.39 bitrate= 862.8kbits/
frame=  113 fps= 34 q=29.0 size=     437kB time=00:00:03.79 bitrate= 943.7kbits/
frame=  125 fps= 33 q=29.0 size=     520kB time=00:00:04.20 bitrate=1012.2kbits/
frame=  138 fps= 32 q=29.0 size=     606kB time=00:00:04.64 bitrate=1069.8kbits/
frame=  151 fps= 31 q=29.0 size=     696kB time=00:00:05.06 bitrate=1124.3kbits/
frame=  163 fps= 30 q=29.0 size=     780kB time=00:00:05.47 bitrate=1166.4kbits/
frame=  176 fps= 30 q=29.0 size=     919kB time=00:00:05.90 bitrate=1273.9kbits/
frame=  196 fps= 31 q=29.0 size=     994kB time=00:00:06.57 bitrate=1237.4kbits/
frame=  213 fps= 31 q=29.0 size=    1097kB time=00:00:07.13 bitrate=1258.8kbits/
frame=  225 fps= 30 q=29.0 size=    1204kB time=00:00:07.53 bitrate=1309.8kbits/
frame=  236 fps= 30 q=29.0 size=    1323kB time=00:00:07.91 bitrate=1369.4kbits/
frame=  249 fps= 29 q=29.0 size=    1451kB time=00:00:08.34 bitrate=1424.6kbits/
frame=  263 fps= 29 q=29.0 size=    1574kB time=00:00:08.82 bitrate=1461.3kbits/
frame=  278 fps= 29 q=29.0 size=    1610kB time=00:00:09.30 bitrate=1416.9kbits/
frame=  296 fps= 30 q=29.0 size=    1655kB time=00:00:09.91 bitrate=1368.0kbits/
frame=  313 fps= 30 q=29.0 size=    1697kB time=00:00:10.48 bitrate=1326.4kbits/
frame=  330 fps= 30 q=29.0 size=    1737kB time=00:00:11.05 bitrate=1286.5kbits/
frame=  345 fps= 30 q=29.0 size=    1776kB time=00:00:11.54 bitrate=1260.4kbits/
frame=  361 fps= 30 q=29.0 size=    1813kB time=00:00:12.07 bitrate=1230.3kbits/
frame=  377 fps= 30 q=29.0 size=    1847kB time=00:00:12.59 bitrate=1201.4kbits/
frame=  395 fps= 30 q=29.0 size=    1880kB time=00:00:13.22 bitrate=1165.0kbits/
frame=  410 fps= 30 q=29.0 size=    1993kB time=00:00:13.72 bitrate=1190.2kbits/
frame=  424 fps= 30 q=29.0 size=    2080kB time=00:00:14.18 bitrate=1201.4kbits/
frame=  439 fps= 30 q=29.0 size=    2166kB time=00:00:14.67 bitrate=1209.4kbits/
frame=  455 fps= 30 q=29.0 size=    2262kB time=00:00:15.21 bitrate=1217.5kbits/
frame=  469 fps= 30 q=29.0 size=    2341kB time=00:00:15.68 bitrate=1223.0kbits/
frame=  484 fps= 30 q=29.0 size=    2430kB time=00:00:16.19 bitrate=1229.1kbits/
frame=  500 fps= 30 q=29.0 size=    2523kB time=00:00:16.71 bitrate=1236.3kbits/
frame=  515 fps= 30 q=29.0 size=    2607kB time=00:00:17.21 bitrate=1240.4kbits/
frame=  531 fps= 30 q=29.0 size=    2681kB time=00:00:17.73 bitrate=1238.2kbits/
frame=  546 fps= 30 q=29.0 size=    2758kB time=00:00:18.24 bitrate=1238.2kbits/
frame=  561 fps= 30 q=29.0 size=    2824kB time=00:00:18.75 bitrate=1233.4kbits/
frame=  576 fps= 30 q=29.0 size=    2955kB time=00:00:19.25 bitrate=1256.8kbits/
frame=  586 fps= 29 q=29.0 size=    3061kB time=00:00:19.59 bitrate=1279.6kbits/
frame=  598 fps= 29 q=29.0 size=    3217kB time=00:00:19.99 bitrate=1318.4kbits/
frame=  610 fps= 29 q=29.0 size=    3354kB time=00:00:20.39 bitrate=1347.2kbits/
frame=  622 fps= 29 q=29.0 size=    3483kB time=00:00:20.78 bitrate=1372.6kbits/
frame=  634 fps= 29 q=29.0 size=    3593kB time=00:00:21.19 bitrate=1388.6kbits/
frame=  648 fps= 29 q=29.0 size=    3708kB time=00:00:21.66 bitrate=1402.3kbits/
frame=  661 fps= 29 q=29.0 size=    3811kB time=00:00:22.08 bitrate=1413.5kbits/
frame=  674 fps= 29 q=29.0 size=    3978kB time=00:00:22.53 bitrate=1446.3kbits/
frame=  690 fps= 29 q=29.0 size=    4133kB time=00:00:23.05 bitrate=1468.4kbits/
frame=  706 fps= 29 q=29.0 size=    4263kB time=00:00:23.58 bitrate=1480.4kbits/
frame=  721 fps= 29 q=29.0 size=    4391kB time=00:00:24.08 bitrate=1493.8kbits/
frame=  735 fps= 29 q=29.0 size=    4524kB time=00:00:24.55 bitrate=1509.4kbits/
frame=  748 fps= 29 q=29.0 size=    4661kB time=00:00:24.98 bitrate=1528.2kbits/
frame=  763 fps= 29 q=29.0 size=    4835kB time=00:00:25.50 bitrate=1553.1kbits/
frame=  778 fps= 29 q=29.0 size=    4993kB time=00:00:25.99 bitrate=1573.6kbits/
frame=  795 fps= 29 q=29.0 size=    5149kB time=00:00:26.56 bitrate=1588.1kbits/
frame=  814 fps= 29 q=29.0 size=    5258kB time=00:00:27.18 bitrate=1584.4kbits/
frame=  833 fps= 29 q=29.0 size=    5368kB time=00:00:27.82 bitrate=1580.2kbits/
frame=  851 fps= 29 q=29.0 size=    5469kB time=00:00:28.43 bitrate=1575.9kbits/
frame=  870 fps= 29 q=29.0 size=    5567kB time=00:00:29.05 bitrate=1569.5kbits/
frame=  889 fps= 29 q=29.0 size=    5688kB time=00:00:29.70 bitrate=1568.4kbits/
Starting second pass: moving header on top of the file
frame=  902 fps= 28 q=-1.0 Lsize=    6109kB time=00:00:30.14 bitrate=1659.8kbits
/s dup=1 drop=0
video:5602kB audio:472kB subtitle:0 global headers:0kB muxing overhead 0.566600%

[libx264 @ 0000000004360620] frame I:8     Avg QP:20.52  size: 39667
[libx264 @ 0000000004360620] frame P:419   Avg QP:25.06  size: 10524
[libx264 @ 0000000004360620] frame B:475   Avg QP:29.03  size:  2123
[libx264 @ 0000000004360620] consecutive B-frames:  3.2% 79.6%  0.3% 16.9%
[libx264 @ 0000000004360620] mb I  I16..4: 20.7% 52.3% 26.9%
[libx264 @ 0000000004360620] mb P  I16..4:  0.7%  4.2%  1.1%  P16..4: 39.4% 21.4
% 13.8%  0.0%  0.0%    skip:19.3%
[libx264 @ 0000000004360620] mb B  I16..4:  0.1%  0.9%  0.3%  B16..8: 41.8%  6.4
%  1.7%  direct: 1.7%  skip:47.1%  L0:36.4% L1:53.3% BI:10.3%
[libx264 @ 0000000004360620] 8x8 transform intra:65.7% inter:58.8%
[libx264 @ 0000000004360620] coded y,uvDC,uvAC intra: 71.2% 76.6% 35.7% inter: 2
0.7% 13.0% 0.5%
[libx264 @ 0000000004360620] i16 v,h,dc,p: 48% 24%  8% 20%
[libx264 @ 0000000004360620] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 18% 15%  6%  8%
11%  8% 10%  8%
[libx264 @ 0000000004360620] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 16% 15%  7% 10%
11%  8%  8%  7%
[libx264 @ 0000000004360620] i8c dc,h,v,p: 51% 22% 19%  9%
[libx264 @ 0000000004360620] Weighted P-Frames: Y:0.7% UV:0.0%
[libx264 @ 0000000004360620] ref P L0: 63.4% 19.7% 11.0%  5.9%  0.0%
[libx264 @ 0000000004360620] ref B L0: 90.7%  8.7%  0.7%
[libx264 @ 0000000004360620] ref B L1: 98.4%  1.6%
[libx264 @ 0000000004360620] kb/s:1524.54


问:
Why does grep -wf return different results then grep -w "line1"
I'm trying to learn how to use grep and I can't figure out why I don't get the same results when I grep a set of files using a string that I get when I use a file with the same exact strings?

in my home directory:

[match/strings.txt]

```<code>    1\.1\.1\.1
    2\.2\.2\.2
</code>```

--strings.txt contains . [dot] escaped ip with no leading or trailing spaces

[ips1,ips2,ips3,ips4]

```<code>   ... massive lists of id's and ip's ...
1234    1.1.2.3
1222    1.1.2.4
</code>```

When I run:

```<code>    $ grep -w "1\.1\.1\.1" ips*
</code>```

I get 100% correct matches everytime.
ips1:1111    1.1.1.1
ips2:1111    1.1.1.1

When I run:

```<code>    $ grep -wf matches/strings.txt ips*
</code>```

I get a mixed bag of correct and incorrect matches
ips1:1112    1.1.1.2
ips1:5111    1.1.1.1
ips1:1511    5.1.1.1

I don't know if I'm just using the wrong tool to do this or if I'm just not greping with the correct options.  I also tried these options:

grep -Ff
grep -wFf
grep -wHFf

None of those give me the same result as grep -w "1.1.1.1", I have tried putting quotes around the ip's in my strings.txt file and that makes no difference I get the same mixed bag of correct and incorrect matches.  I have also tried just matching a single file rather than all ips* at once and I get the same mixed bag of results.

Here is some real data with extra line breaks added... The real strings.txt does not have an empty line between dot escaped IPs it was just taking too long to format it to show up correctly.

grep -wf match/strings.txt ips* | more

ips1:    0     100.0.109.83

ips1:    0    100.10.42.110

ips1:    0    100.1.100.194

ips1:    0     100.1.111.51

d:~$ cat match/strings.txt

"100\.4\.144\.28"

"205\.154\.246\.79"

"172\.58\.23\.203"

"172\.58\.21\.242"

"172\.58\.21\.186"

"172\.58\.23\.212"

"172\.58\.21\.32"

"104\.174\.15\.38"

"67\.87\.1\.146"

"128\.177\.161\.177"

"172\.58\.21\.228"

"172\.58\.23\.19"

"172\.56\.38\.234"

"173\.46\.78\.139"

"100\.4\.149\.40"

"107\.195\.45\.250"

"205\.197\.242\.184"

"128\.177\.161\.161"

without any quotes in strings.txt

~$ grep -wf match/strings.txt ips* | more
ips1:    0      100.34.7.21

ips1:    0   100.35.114.199

ips1:    0    100.35.148.65

ips1:    0    100.35.161.40

ips1:    0   100.35.195.180

ips1:    0   100.35.211.106

ips1:    0   100.35.216.172

:~$ cat match/strings.txt

100\.4\.144\.28

205\.154\.246\.79

172\.58\.23\.203

172\.58\.21\.242

172\.58\.21\.186

172\.58\.23\.212

172\.58\.21\.32

104\.174\.15\.38

67\.87\.1\.146

128\.177\.161\.177

172\.58\.21\.228

172\.58\.23\.19

172\.56\.38\.234

173\.46\.78\.139

100\.4\.149\.40

107\.195\.45\.250

205\.197\.242\.184

128\.177\.161\.161

Here is a sample of actual data from ips1 (extra line breaks added):

```<code>0     100.0.109.83

0    100.10.42.110

0    100.1.100.194

0     100.1.111.51

0     100.1.138.93

0     100.1.149.82

0     100.11.60.70

0     100.1.187.63

0   100.12.159.242

0   100.12.184.253

0   100.12.190.121

0   100.12.202.213

0    100.12.204.57

0    100.12.223.81

0    100.12.229.63

0   100.12.242.176

0     100.1.227.10

0    100.12.46.230

0     100.12.50.64

0     100.12.71.66

0     100.1.38.139
</code>```

Removing everything from that file and adding one line at a time fixed the issue.  I'm not sure why probably something odd caused by copy and pasting from an Excel document is my best guess.

:~$ grep -w "100\.4\.144\.28" ips* | wc -l

11

~$ grep -wf match/strings.txt ips* | wc -l

11

$ grep -wf match/strings.txt ips* | wc -l

29

$ grep -w "107\.195\.45\.250" ips* | wc -l

18

$ grep -wf match/strings.txt ips* | wc -l

37

$ grep -w "172\.58\.23\.19" ips* | wc -l

8

答:
Are you certain that your files contain what you think they do? I just gave it a go. What is different about what I have and what you have?</p>

```<code>$ cat strings.txt
1\.1\.1\.1
$ cat ips.txt
1111 1.1.1.1
2222 2.2.2.2
1112 1.1.1.2
2221 2.2.2.1
1111b 1.1.1.1
2222b 2.2.2.2
$ grep -w "1\.1\.1\.1" ips*
1111 1.1.1.1
1111b 1.1.1.1
$ grep -wf strings.txt ips*
1111 1.1.1.1
1111b 1.1.1.1
</code>```

Body:
I'm trying to learn how to use grep and I can't figure out why I don't get the same results when I grep a set of files using a string that I get when I use a file with the same exact strings?

in my home directory:

[match/strings.txt]

    1\.1\.1\.1
    2\.2\.2\.2

--strings.txt contains . [dot] escaped ip with no leading or trailing spaces

[ips1,ips2,ips3,ips4]

   ... massive lists of id's and ip's ...
1234    1.1.2.3
1222    1.1.2.4

When I run:

    $ grep -w "1\.1\.1\.1" ips*

I get 100% correct matches everytime.
ips1:1111    1.1.1.1
ips2:1111    1.1.1.1

When I run:

    $ grep -wf matches/strings.txt ips*

I get a mixed bag of correct and incorrect matches
ips1:1112    1.1.1.2
ips1:5111    1.1.1.1
ips1:1511    5.1.1.1

I don't know if I'm just using the wrong tool to do this or if I'm just not greping with the correct options.  I also tried these options:

grep -Ff
grep -wFf
grep -wHFf

None of those give me the same result as grep -w "1.1.1.1", I have tried putting quotes around the ip's in my strings.txt file and that makes no difference I get the same mixed bag of correct and incorrect matches.  I have also tried just matching a single file rather than all ips* at once and I get the same mixed bag of results.

Here is some real data with extra line breaks added... The real strings.txt does not have an empty line between dot escaped IPs it was just taking too long to format it to show up correctly.

grep -wf match/strings.txt ips* | more

ips1:    0     100.0.109.83

ips1:    0    100.10.42.110

ips1:    0    100.1.100.194

ips1:    0     100.1.111.51

d:~$ cat match/strings.txt

"100\.4\.144\.28"

"205\.154\.246\.79"

"172\.58\.23\.203"

"172\.58\.21\.242"

"172\.58\.21\.186"

"172\.58\.23\.212"

"172\.58\.21\.32"

"104\.174\.15\.38"

"67\.87\.1\.146"

"128\.177\.161\.177"

"172\.58\.21\.228"

"172\.58\.23\.19"

"172\.56\.38\.234"

"173\.46\.78\.139"

"100\.4\.149\.40"

"107\.195\.45\.250"

"205\.197\.242\.184"

"128\.177\.161\.161"

without any quotes in strings.txt

~$ grep -wf match/strings.txt ips* | more
ips1:    0      100.34.7.21

ips1:    0   100.35.114.199

ips1:    0    100.35.148.65

ips1:    0    100.35.161.40

ips1:    0   100.35.195.180

ips1:    0   100.35.211.106

ips1:    0   100.35.216.172

:~$ cat match/strings.txt

100\.4\.144\.28

205\.154\.246\.79

172\.58\.23\.203

172\.58\.21\.242

172\.58\.21\.186

172\.58\.23\.212

172\.58\.21\.32

104\.174\.15\.38

67\.87\.1\.146

128\.177\.161\.177

172\.58\.21\.228

172\.58\.23\.19

172\.56\.38\.234

173\.46\.78\.139

100\.4\.149\.40

107\.195\.45\.250

205\.197\.242\.184

128\.177\.161\.161

Here is a sample of actual data from ips1 (extra line breaks added):

0     100.0.109.83

0    100.10.42.110

0    100.1.100.194

0     100.1.111.51

0     100.1.138.93

0     100.1.149.82

0     100.11.60.70

0     100.1.187.63

0   100.12.159.242

0   100.12.184.253

0   100.12.190.121

0   100.12.202.213

0    100.12.204.57

0    100.12.223.81

0    100.12.229.63

0   100.12.242.176

0     100.1.227.10

0    100.12.46.230

0     100.12.50.64

0     100.12.71.66

0     100.1.38.139

Removing everything from that file and adding one line at a time fixed the issue.  I'm not sure why probably something odd caused by copy and pasting from an Excel document is my best guess.

:~$ grep -w "100\.4\.144\.28" ips* | wc -l

11

~$ grep -wf match/strings.txt ips* | wc -l

11

$ grep -wf match/strings.txt ips* | wc -l

29

$ grep -w "107\.195\.45\.250" ips* | wc -l

18

$ grep -wf match/strings.txt ips* | wc -l

37

$ grep -w "172\.58\.23\.19" ips* | wc -l

8

Body:
Are you certain that your files contain what you think they do? I just gave it a go. What is different about what I have and what you have?

$ cat strings.txt
1\.1\.1\.1
$ cat ips.txt
1111 1.1.1.1
2222 2.2.2.2
1112 1.1.1.2
2221 2.2.2.1
1111b 1.1.1.1
2222b 2.2.2.2
$ grep -w "1\.1\.1\.1" ips*
1111 1.1.1.1
1111b 1.1.1.1
$ grep -wf strings.txt ips*
1111 1.1.1.1
1111b 1.1.1.1