小编lil*_*lzz的帖子

试图了解CMTime和CMTimeMake

1)CMTimeMake(1,10)表示1秒的持续时间和10或10帧/秒的时标.这意味着1帧视频的持续时间为10帧?

2)

CMTime lastTime=CMTimeMake(1,10);
CMTime frameTime=CMTimeMake(1, 10);
CMTime currentTime=CMTimeAdd(lastTime, frameTime)
Run Code Online (Sandbox Code Playgroud)

=(2,10)?

2秒的视频和每秒10帧的当前时间?

video ios4

141
推荐指数
4
解决办法
7万
查看次数

在Java语法中,Class <?扩展某事>

Class<? extends Something>

这是我的解释,它是班级模板但课程?表示类的名称未确定,它扩展了Something类.

如果我的解释有问题,请告诉我.

java generics

53
推荐指数
4
解决办法
7万
查看次数

ASSETWriterInput用于在Iphone问题上从UIImages制作视频

我尝试了以下两种方法来附加UIImages pixelbuffer ASSETWriterInput.除了视频文件中没有数据外,一切看起来都不错.怎么了?

1适配器类

AVAssetWriterInputPixelBufferAdaptor * avAdaptor = [AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:writerInput sourcePixelBufferAttributes:NULL];

[avAdaptor appendPixelBufferixelBuffer withPresentationTime:CMTimeMake(1, 10)];
Run Code Online (Sandbox Code Playgroud)

2制作

// Create sample buffer.
CMSampleBufferRef sampleBuffer = NULL;
result = CMSampleBufferCreateForImageBuffer(kCFAllocatorDef ault, pixelBuffer, true, NULL, NULL, videoInfo, &timing, &sampleBuffer);

// Ship out the frame.
NSParameterAssert(CMSampleBufferDataIsReady(sample Buffer));
NSParameterAssert([writerInput isReadyForMoreMediaData]);
BOOL success = [writerInput appendSampleBuffer:sampleBuffer];
Run Code Online (Sandbox Code Playgroud)

iphone video image avfoundation

26
推荐指数
1
解决办法
2万
查看次数

Xcode的用户头搜索路径

我有两个路径,我希望Xcode搜索标题:

"/ myproject/lib1/include"
"/ myproject/lib2/include"

在Xcode的用户标题搜索路径中添加这两个路径的正确语法是什么?我试过"/ myproject/lib1/include";"/ myproject/lib2/include"

但它没有用.它抱怨找不到object1.h.object1在/ myproject/lib1/include里面

我已经将整个/ myproject/lib1/include文件夹和/ myproject/lib2/include文件夹添加到目标项目中.

xcode

21
推荐指数
3
解决办法
5万
查看次数

Android NDK __android_log_print函数和LogCat

我有一个像这样的功能

__android_log_print(ANDROID_LOG_INFO, "HelloNDK!");
Run Code Online (Sandbox Code Playgroud)

在我的C代码上

我在LogCat上找不到那个输出.我需要设置什么样的过滤器

通过Log Tag,Log Message,Application Name,Log Level ...等.

android android-ndk

13
推荐指数
1
解决办法
4万
查看次数

如何使用AVAssetWriter制作缩小尺寸的视频?

我会制作缩小尺寸的视频,可能是50像素,75像素长.这些是物理方面.

你怎么设置的?在视频设计?我认为AVVideoWidthKey和AVVideoHeightKey更适用于我需要的物理尺寸分辨率.

NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                               AVVideoCodecH264, AVVideoCodecKey,
                               [NSNumber numberWithInt: 320], AVVideoWidthKey,    
                               [NSNumber numberWithInt:480], AVVideoHeightKey,   
                               nil];
AVAssetWriterInput* writerInput = [[AVAssetWriterInput
                                    assetWriterInputWithMediaType:AVMediaTypeVideo
                                    outputSettings:videoSettings] retain
Run Code Online (Sandbox Code Playgroud)

video ios avvideocomposition avassetexportsession

10
推荐指数
2
解决办法
2万
查看次数

从PNG文件的UIImage制作时,视频的颜色是错误的

我从Png文件中获取UIImage并将其提供给videoWriter.

avAdaptor appendPixelBuffer:pixelBuffer

当最终结果视频出来时,它似乎缺少一种颜色,缺少黄色或其他东西.

我采用了使像素缓冲区脱离UIImage的功能

CVPixelBufferCreateWithBytes(NULL,
                             myWidth,
                             myHeight,
                             kCVPixelFormatType_32BGRA, 
                             (void*)CFDataGetBytePtr(image), 
                             CGImageGetBytesPerRow(cgImage), 
                             NULL, 
                             0,
                             NULL, 
                             &pixelBuffer);
Run Code Online (Sandbox Code Playgroud)

我也尝试了kCVPixelFormatType_32AGRB和其他人,它没有帮助.

有什么想法吗?

iphone video

9
推荐指数
1
解决办法
696
查看次数

如何在Android上显示启动画面3秒?

我希望启动图像开始并保持3秒钟,然后消失并继续或替换为main.xml中的其余布局.

这是我的代码:

Main.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.main);

    ImageView splash = (ImageView) this.findViewById(R.id.splash);
Run Code Online (Sandbox Code Playgroud)

main.xml中

<?xml version="1.0" encoding="utf-8"?>
<!-- margin=0px, padding=20px -->
<!--textview padding=10dp, textSize=16sp-->
<!--px=pixel, dp=density indepen sp=scale indepen fontsize preference -->
<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">

   <ImageView
    android:id="@+id/splash"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:src="@drawable/splash2"/> 

  <ImageView
    android:id="@+id/myImageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/bg_main"/> 

  <ImageView
    android:id="@+id/myImageView0"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/bar_top"/> 

<!-- 
  <TextView android:id="@+id/textItem"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:paddingTop="10dp"
    android:paddingLeft="110dp"
    android:background="#00000000"
    android:textColor="#ffffffff"
    android:textSize="22sp" 
    android:text="Find Car"
    android:enabled="false"  
  >
-->

<TabHost android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
<RelativeLayout
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:padding="3dp">
   <FrameLayout …
Run Code Online (Sandbox Code Playgroud)

android

8
推荐指数
4
解决办法
3万
查看次数

如何连续回收UIView动画

以下代码将图像视图从右向左移动一次,但我想继续进行.向右移动到左边然后再向左移动并再次从右向左重复.

imageview=[[UIImageView alloc] initWithFrame:CGRectMake(320, 200, 2635, 200)];

image=[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"animal" ofType:@"png"]]; 
               [imageview setImage:image];

[self.view addSubview:imageview];

[UIView beginAnimations:@"MoveAndStrech" context:nil];
[UIView setAnimationDuration:40];     //30
[UIView setAnimationBeginsFromCurrentState:YES];
CGPoint p, b, a, c, d,e;
p.x = 0;
p.y = 200;

imageview.center=p;

[UIView commitAnimations];  
Run Code Online (Sandbox Code Playgroud)

iphone animation

6
推荐指数
1
解决办法
5556
查看次数

以下C宏有什么作用?

#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
Run Code Online (Sandbox Code Playgroud)

##在C中意味着什么?这是占位符还是功能?

c

6
推荐指数
1
解决办法
759
查看次数