OpenWatch / FFmpegWrapper

A lightweight Objective-C wrapper for some FFmpeg libav functions
Other
179 stars 54 forks source link

Codec not found mpeg4 #7

Open emrsn-mihailpopa opened 9 years ago

emrsn-mihailpopa commented 9 years ago

I try to decode a video encoded using mpeg4 format (mp4v). When the library reaches the point where it searches for CODEC_ID_MPEG4, I get a message: "codec not found: mpeg4"

VicenteFava commented 9 years ago

I got the following: codec not found: h264

Any solution?

rafaelmaroxa commented 8 years ago

@VicenteFava have you figured out something? I tried multiple configurations, but I am still seeing the same problem. halp

VicenteFava commented 8 years ago

Sorry @rafaelmaroxa, I haven't found a solution. I tried different configurations too.

fzakaria commented 8 years ago

So, i'm not sure why but on iPhone you have h264 as decoder and libx264 as encoder for lookup.

I added the following line:

- (id) initWithOutputFile:(FFOutputFile*)outputFile outputCodec:(NSString*)outputCodec {
    if (self = [super initWithFile:outputFile]) {
        self.lastMuxDTS = AV_NOPTS_VALUE;
        self.frameNumber = 0;

        if ([outputCodec  isEqual: @"h264"]){
            outputCodec = @"libx264";
        }

        AVCodec *codec = avcodec_find_encoder_by_name([outputCodec UTF8String]);
        if (!codec) {
            NSLog(@"codec not found: %@", outputCodec);
        }
        self.stream = avformat_new_stream(outputFile.formatContext, codec);
        [outputFile addOutputStream:self];
    }
    return self;
}
netsutra commented 8 years ago

Please help me to get a solution for this problem.

Gigibit commented 5 years ago

have you solved this issue?