我有两个属性"M"和"m",不是我所知道的最好的编码风格,但是请耐心等待.在init方法中对这些属性的赋值无法正常运行.这是完整的代码:
#import "AppDelegate.h"
@interface Foo : NSObject
@property (nonatomic, assign) int M;
@property (nonatomic, assign) int m;
- (id)initWithM:(int)M m:(int)m;
@end
@implementation Foo
- (id)initWithM:(int)M m:(int)m {
if((self = [super init])) {
self.M = M;
printf("M = %d %d\n", M, self.M);
self.m = m;
printf("M = %d %d\n", M, self.M);
printf("m = %d %d\n", m, self.m);
}
return self;
}
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
Foo *f = [[Foo alloc] …Run Code Online (Sandbox Code Playgroud) 我有一个原始 h264 文件,可以在 Mac 上使用 VLC 显示:
打开-a VLC文件.h264
我可以使用命令行将其转换为 mp4
ffmpeg -f h264 -i file.h264 -c:v copy file.mp4
但我真正想做的是:
猫文件.h264 | ffmpeg > 文件.mp4
原因是输入是通过套接字传输的,我想将其转换并即时发送到 html 文件中的视频标签。
另一种解决方案是在网页中显示原始 h264,而不先将其转换为 mp4。
输入是逐帧输入的,前四个字节是 0,0,0,1。我的理解是这个h264附件B格式。
我对视频格式一无所知,我很高兴能指出一个方向来看看。
我应该像这个问题一样考虑使用 libavcodec 编写代码还是有现成的解决方案?
使用 libavformat 混合到 MP4 的 H.264 无法播放
谢谢!
任务可以在这里找到:http://www.talentbuddy.co/challenge/51846c184af0110af3822c32
我关于这项任务的计划如下:
#include <stdio.h>
#include<string.h>
void tokenize_query(char *query, char *punctuation) {
int i,j,ok=1,k,t;
char x[1000];
for(i=0;i<strlen(query);i++)
{
ok=1;
for(j=0;j<strlen(punctuation);j++)
{
if(query[i]==punctuation[j] || query[i]==' ')
ok=0;
}
if(ok!=0)
{
x[k]=query[i];
k++;
}
else {
for(t=0;t<k;t++)
{
printf("%c",x[t]);
}
k=0;
printf("\n");
}
}
}
Run Code Online (Sandbox Code Playgroud)