Get Started         Best Practices         Developer Guide         FAQ        
Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Hard working around with video playback

Rajesh Sep 01, 2017

Dear Catchoom team,

I've been very close in completing a project based the cordova plugin, apart completing the major portion - I've been struggling with the video playback thing. Some of the .mp4 file plays fine and some doesn't. What i do is i record a video from my android device and use that default .mp4 recorded video to project on the marker.

My core requirement is take a video from device and use it to display on the marker. I've tried uploading the video directly, tried compressing and upload. Nothing worked out in dealing with the android recorded video.

here is the link from my video which is not working

http://testourwork.com/snapreality/markers/videos/2/vivegam-1.mp4

Let me know what was the issue and how to get my work done.

Also here is my code for compress method and the filetransfer

VideoEditor.transcodeVideo(
$scope.videoTranscodeSuccess,
$scope.videoTranscodeError,
{
fileUri: param.orgpath,
outputFileName: videoFileName,
outputFileType: VideoEditorOptions.OutputFileType.MPEG4,
optimizeForNetworkUse: VideoEditorOptions.OptimizeForNetworkUse.YES,
saveToLibrary: false,
maintainAspectRatio: true,
width: 640,
height: 640,
videoBitrate: 1000000, // 1 megabit
audioChannels: 2,
audioSampleRate: 44100,
audioBitrate: 128000, // 128 kilobits
progress: function(info) {
document.getElementById('video-compress-progress').innerHTML = "Preparing.. " + Math.round(info * 100) + "%";
console.log('transcodeVideo progress callback, info: ' + info);
}
}
);


var uploadVideoParam = $scope.captureVideopath[0];
var fileURL = uploadVideoParam.path;
var fileType = uploadVideoParam.type;
var fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
var uri = encodeURI("http://uploaduri")
var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = fileName;
options.mimeType = "video/mp4";
options.chunkedMode = false;
options.params = {'fileName': fileName, 'targetimage': $scope.pictureSelected};
var ft = new FileTransfer();
ft.onprogress = function(progressEvent) {
console.log(progressEvent);
var progressPercent = (progressEvent.loaded / progressEvent.total) *100;
document.getElementById('video-upload-progress').innerHTML = "Uploading.. " + Math.round(progressPercent) + "%";
};
ft.upload(fileURL, uri, $scope.uploadToServerSuccess, $scope.uploadToServerError, options);

Thank you
Rajesh


rajesh

Sep 01, 2017

Hi,

Even i tried converting the video using FFmpeg as per your documentation and it doesn't work though. https://support.catchoom.com/customer/en/portal/articles/1896418-preparing-video-content-for-the-craftar-augmented-reality-sdk

here is the code

var command = ffmpeg("vivegam.avi").output('vivegam-1.mp4')
.videoBitrate('300k')
.videoCodec('libx264')
.audioCodec('aac')
.audioBitrate('96k')
.audioChannels(2)
.size('640x360')
.on('end', function() {
console.log('Finished processing');
})
.run();


Let me know asap.

Thank you
Rajesh
0 rated
( Agent )
Luis Martinell

Sep 04, 2017

Hi Rajesh,

In the link you shared, the video is not using H.264 encoding and I cannot open it with VLC or other players. Can you share a link to the video encoded with H.264? does that one work?

0 rated
Rajesh

Sep 04, 2017

Dear Luis Martinell,

Thank you for your reply.

Here i got video link for both working and notworking .mp4 file.

http://testourwork.com/snapreality/videos/working.mp4
http://testourwork.com/snapreality/videos/notworking.mp4

the video working.mp4 works well, where as the notworking.mp4 is not rendering and having problem.

Can you please check and let me know, where things went wrong.

Also let me know, is there any kind of API thing to test validate the .mp4 file?

Kindly reply and get me a best solution to tackle this thing - main idea of my app is to let user to upload video and see it on the marker on fly. So i need the video taken from the android/ ios camera or from the mobile library to play well in my case.

I am almost completed the app to deliver and finally i was held up with this issue. If possible send me an email notify on your reply, so that i can catch you quickly and get this sorted.

Thank you and looking forward to your early reply.
Rajesh
0 rated
( Agent )
Luis Martinell

Sep 05, 2017

Hi,

I’m checking the encoding information with VLC and I see differences between the “working” one and the “notworking” one. Looks like the one that doesn’t work has a difference between the resolution and the display resolution and the decoded format is specified (YUV) I’m not sure if this affects.

How are the different videos produced?

0 rated
Rajesh

Sep 05, 2017

Hi,

Thank you for your reply.

I am not sure that was the case (decide with YUV). I hope you've tested that both the videos works well with the vlc, just wondering why is not working in the app.

Can you guide me on how to further proceed - as my requirement is user upload videos to see their uploaded video on the marker on a fly (instant).

Thank you
Rajesh
0 rated
( Agent )
Luis Martinell

Sep 05, 2017

Hi Rajesh,

You need to make sure your users upload a video that’s compatible with the Android media player. We directly use it inside the SDK and if the video doesn’t load, there’s probably a problem with the codification. You’d need to check if the encoding is correct for every video and decide if you want to re-encode it or just give an error.

Best regards,
Luis

0 rated

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Couldn't find what you were looking for?

support@catchoom.com
https://cdn.desk.com/
false
catchoom
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete