我想要的是
1. Get video packet from stream source
2. Decode it
3. And write that decoded data as video file(avi, mpeg etc)
Run Code Online (Sandbox Code Playgroud)
我可以从文件中获取视频数据包(如AVPacket),也可以解码并保存为图像.(原始)(FFmpeg教程显示如何操作). 但我不能(不知道)将视频数据写入可由媒体播放器(如VLC)播放的文件(其他).
最好的祝愿
Ps:如果可能的话,真正的代码样本会很棒......
现在我用av_interleaved_write进行测试, 但我得到了奇怪的错误"非单调时间戳"(我无法控制媒体源的pts值)
一些额外的信息
在FFmpeg,我必须
我需要读者和作家.我可以读取媒体源文件(甚至根据给定的格式对数据包进行编码).但是我不能写文件......(任何玩家都可以玩)
还有一些伪代码
File myFile("MyTestFile.avi");
while ( source ->hasVideoPackets)
{
packet = source->GetNextVideoPacket();
Frame decodedFrame = Decode(packet);
VideoPacket encodedPacket = Encode( decodedFrame);
myFile.WriteFile(encodedPacket);
}
Run Code Online (Sandbox Code Playgroud)
或者只是编写没有编码解码的原始文件
File myFile("MyTestFile.avi");
while ( source ->hasVideoPackets)
{
packet = source->GetNextVideoPacket();
myFile.WriteFile(packet);
}
Run Code Online (Sandbox Code Playgroud)
然后
I can able to …
Run Code Online (Sandbox Code Playgroud) 我有一个editText,起始值是0.00美元.按1时,它变为$ 0.01.按4,它达到$ 0.14.按8,$ 1.48.按退格键,0.14美元等
这是有效的,问题是,如果有人手动定位光标,格式化中会出现问题.如果他们要删除小数,它就不会回来.如果他们将光标放在小数前面并输入2,它将显示$ 02.00而不是$ 2.00.例如,如果他们试图删除$,它将删除一个数字.
这是我正在使用的代码,我很感激任何建议.
mEditPrice.setRawInputType(Configuration.KEYBOARD_12KEY);
public void priceClick(View view) {
mEditPrice.addTextChangedListener(new TextWatcher(){
DecimalFormat dec = new DecimalFormat("0.00");
@Override
public void afterTextChanged(Editable arg0) {
}
@Override
public void beforeTextChanged(CharSequence s, int start,
int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start,
int before, int count) {
if(!s.toString().matches("^\\$(\\d{1,3}(\\,\\d{3})*|(\\d+))(\\.\\d{2})?$"))
{
String userInput= ""+s.toString().replaceAll("[^\\d]", "");
if (userInput.length() > 0) {
Float in=Float.parseFloat(userInput);
float percen = in/100;
mEditPrice.setText("$"+dec.format(percen));
mEditPrice.setSelection(mEditPrice.getText().length());
}
}
}
});
Run Code Online (Sandbox Code Playgroud) 我使用Hibernate Envers进行审计.我的实体看起来像这样:
@Entity
@Audited
public class Child
{
@GeneratedValue
@Id
@Column
private Long id;
@Column
private String test;
// getters & setters
}
Run Code Online (Sandbox Code Playgroud)
现在我想查询这样的修订:
query = reader.createQuery().forRevisionsOfEntity(Child.class, false, true);
query.add(AuditEntity.property("test").eq("child1"));
Long id = ...;
query = reader.createQuery().forRevisionsOfEntity(Child.class, false, true);
query.add(AuditEntity.property("id").eq(id));
Run Code Online (Sandbox Code Playgroud)
第一个查询有效,执行第二个查询会抛出以下异常:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map
at org.hibernate.property.MapAccessor$MapGetter.get(MapAccessor.java:118)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:77)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValues(AbstractComponentTuplizer.java:83)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:381)
at org.hibernate.type.ComponentType.nullSafeGetValues(ComponentType.java:354)
at org.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:309)
at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:67)
at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:567)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1612)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.doList(Loader.java:2294)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2172)
at org.hibernate.loader.Loader.list(Loader.java:2167)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:448)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) …
Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我想将多张照片附加到代码中的电子邮件中,并将多张照片发布到Web组件.我在Android中通过压缩它们并通过在两者之间添加边界来发布它们.
在iPhone上,有没有直接的方法将多个图像附加到电子邮件中,还是我必须将它们全部压缩?
我试图在VisualForce中格式化日期,使它看起来像这样:
Tuesday 02/22/11
Run Code Online (Sandbox Code Playgroud)
我在stackoverflow上找到了这个引用:
但我无法确定格式字符串中的内容.
我尝试使用e
这里引用的:
http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html
但是当我这样做时:
<apex:outputText value="{0,date,MM'/'e'/'yy}">
<apex:param value="{!od.PriceBookEntry.Product2.Start__c}" />
</apex:outputText>
Run Code Online (Sandbox Code Playgroud)
我收到一个保存错误:
保存错误:日期格式模式无效
<apex:outputText value="{0,date,EEE MM'/'yy}">
<apex:param value="{!od.PriceBookEntry.Product2.Start__c}" />
</apex:outputText>
Run Code Online (Sandbox Code Playgroud) 我发现了许多关于使用IMAP的虚拟信息,但我不明白如何将它用于我的目的.我发现如何从邮箱和所有SEEN消息中获取所有消息,但我应该如何处理星星?请给我一些python代码示例,用于从GMail通过IMAP4获取已加星标的消息,以检查某些消息是否已加星标或取消星标,以便主演和取消选择某条消息.
只是想就此事提出一些意见.我一直使用int标志,如果我在Java中使用枚举,只是对可能的易用性表现感到好奇吗?
我已经阅读了有关如何不在一个DLL中分配堆内存并从该DLL外部解除分配的各种事项.但是抛出一个只是临时的异常对象(如大多数异常对象)呢?例如:
throw my_exception( args ); // temporary: no heap allocation
Run Code Online (Sandbox Code Playgroud)
当异常对象被捕获到DLL外部时,最终将执行该对象的析构函数,并将回收该对象的非堆内存.这样可以,因为它不是堆内存吗?
我们正在使用fusioncharts,它能够在客户端使用javascript导出csv数据,我们希望能够在浏览器中随时获取该数据并创建文件.那可能吗?怎么样?
我有一个基类,它为应用程序中的所有页面实现了一些基本的身份验证.
public class BasePage : Page
{
public void Page_PreLoad(object sender, EventArgs e)
{
if (!IsUserValid())
{
Response.Redirect("default.aspx");
}
}
}
public class AuthenticatedUser : BasePage
{
public void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Databind();
}
}
}
Run Code Online (Sandbox Code Playgroud)
如果用户无效,如何停止AuthenticatedUser的页面生命周期?
谢谢,Ashwani
android ×1
apex-code ×1
asp.net ×1
c ×1
c++ ×1
cocoa-touch ×1
datetime ×1
dll ×1
enumeration ×1
ffmpeg ×1
hibernate ×1
html ×1
imap ×1
int ×1
iphone ×1
java ×1
javascript ×1
python ×1
salesforce ×1
visualforce ×1