Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6627971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:04:34+00:00 2026-05-25T22:04:34+00:00

I am using GData Api to upload video on youtube from ios application. It

  • 0

I am using GData Api to upload video on youtube from ios application.
It successfully uploads the video but audio is missing from that.

I am using .mp4 format of video.
Do any one has a clue?

Thanks

-(BOOL) setupWriter{
    NSError *error = nil;
//  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
//  NSString *documentsDirectory = [paths objectAtIndex:0];
//  NSURL * url = [NSURL URLWithString:documentsDirectory];
//  url = [url URLByAppendingPathComponent:@"om.mp4"];


    //  NSString *path = [documentsDirectory stringByAppendingPathComponent:@"om.mp4"];
    //  [data writeToFile:path atomically:YES];


NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Documents/movie.mp4"]];
_videoWriter = [[AVAssetWriter alloc] initWithURL:[NSURL fileURLWithPath:path] fileType:AVFileTypeQuickTimeMovie
                                            error:&error];
NSParameterAssert(_videoWriter);


    // Add video input
NSDictionary *videoCompressionProps = [NSDictionary dictionaryWithObjectsAndKeys:
                                       [NSNumber numberWithDouble:128.0*1024.0], AVVideoAverageBitRateKey,
                                       nil ];

NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                               AVVideoCodecH264, AVVideoCodecKey,
                               [NSNumber numberWithInt:192], AVVideoWidthKey,
                               [NSNumber numberWithInt:144], AVVideoHeightKey,
                               videoCompressionProps, AVVideoCompressionPropertiesKey,
                               nil];

_videoWriterInput = [[AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo
                                                        outputSettings:videoSettings] retain];


float   angle = M_PI/2;  //rotate 180°, or 1 π radians
_videoWriterInput.transform = CGAffineTransformMakeRotation(angle);


NSParameterAssert(_videoWriterInput);
_videoWriterInput.expectsMediaDataInRealTime = YES;


    // Add the audio input
AudioChannelLayout acl;
bzero( &acl, sizeof(acl));
acl.mChannelLayoutTag = kAudioChannelLayoutTag_Mono;


NSDictionary* audioOutputSettings = nil;          
    // Both type of audio inputs causes output video file to be corrupted.
if( NO ) {
        // should work from iphone 3GS on and from ipod 3rd generation
    audioOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                           [ NSNumber numberWithInt: kAudioFormatMPEG4AAC ], AVFormatIDKey,
                           [ NSNumber numberWithInt: 1 ], AVNumberOfChannelsKey,
                           [ NSNumber numberWithFloat: 44100.0 ], AVSampleRateKey,
                           [ NSNumber numberWithInt: 64000 ], AVEncoderBitRateKey,
                           [ NSData dataWithBytes: &acl length: sizeof( acl ) ], AVChannelLayoutKey,
                           nil];
} else {
        // should work on any device requires more space
    audioOutputSettings = [ NSDictionary dictionaryWithObjectsAndKeys:                       
                           [ NSNumber numberWithInt: kAudioFormatAppleLossless ], AVFormatIDKey,
                           [ NSNumber numberWithInt: 16 ], AVEncoderBitDepthHintKey,
                           [ NSNumber numberWithFloat: 44100.0 ], AVSampleRateKey,
                           [ NSNumber numberWithInt: 1 ], AVNumberOfChannelsKey,                                      
                           [ NSData dataWithBytes: &acl length: sizeof( acl ) ], AVChannelLayoutKey,
                           nil ];
} 

_audioWriterInput = [[AVAssetWriterInput 
                      assetWriterInputWithMediaType: AVMediaTypeAudio 
                      outputSettings: audioOutputSettings ] retain];

_audioWriterInput.expectsMediaDataInRealTime = YES;




    // add input
[_videoWriter addInput:_videoWriterInput];
[_videoWriter addInput:_audioWriterInput];

return YES;
}

this is setup writer I am using to capture audio is something wring in this????

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:04:35+00:00Added an answer on May 25, 2026 at 10:04 pm

    From the CamStudio Support Forum:

    .MOV / .MP4 / .3GPP files

    MOV /MP4 /3GPP files are index based. Simply put, this means that
    there is an index in the file that tells us the specific location of
    where in the file the video and audio frames are present. Without the
    index, it is almost impossible to know where the data for a specific
    video or audio frame is. This index is contained in what is called a
    ‘moov’ atom in the file.

    Now, if the index is at the beginning of the file, it will enable
    processing of the video as and when successive bytes of the file are
    uploaded. On the other hand, if the index is at the end, processing
    the video cannot begin until the entire upload is complete – since the
    index is needed to interpret the file.

    Hence, for MOV / MP4 / 3gpp files, we prefer the “moov” atom in the
    beginning of the file – also known as a “fast start”MP4 / MOV file.
    There are tools available on the web to flatten your MOV file. Usually
    the video editing/export software will have options to create your
    files with the moov atom in the beginning rather than the end of your
    file. If you are using Apple editing tools, then see this article on
    how to produce a “fast start” MP4/MOV file./p>

    Here’s a list of some well-known formats that YouTube supports:

    WebM files – Vp8 video codec and Vorbis Audio codecs

    .MPEG4, 3GPP and MOV files – Typically supporting h264, mpeg4 video
    codecs, and AAC audio codec

    .AVI – Many cameras output this format – typically the video codec is
    MJPEG and audio is PCM

    .MPEGPS – Typically supporting MPEG2 video codec and MP2 audio

    .WMV

    .FLV – Adobe-FLV1 video codec, MP3 audio

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using google's GData API in order to upload a video to youtube
I am trying to upload a youtube video using the GData gem (I have
This is what we use to upload a Video to YouTube using YouTube API.
I using Zend Gdata library for search video Youtube API. If I make a
I wanted to upload a video on youtube using Java Google Data API. I
I'm trying to upload a video to YouTube using the PHP Data API $yt
i am using the ZEND Gdata and youtube api to upload vidoes to youtube
I'm using Zend_Gdata_YouTube to interface with the YouTube API to upload videos from my
I'm creating a web application that uploads websites from my server to youtube on
Since Days i'm trying to parse a YOUTUBE-XML-Feed by using GDATA-API for iOS. http://code.google.com/intl/de-DE/apis/youtube/2.0/developers_guide_protocol_channel_search.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.