Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't convert the video #1

Open
MahmoudElmoghazy opened this issue Aug 7, 2017 · 6 comments
Open

Can't convert the video #1

MahmoudElmoghazy opened this issue Aug 7, 2017 · 6 comments

Comments

@MahmoudElmoghazy
Copy link

MahmoudElmoghazy commented Aug 7, 2017

Thank u for this module but unfortunately i can't convert the file plz check the code :)

             var intent = Titanium.Android.createIntent({
                              action: Ti.Android.ACTION_PICK,
                              type: "video/*"
               });

            intent.addCategory(Ti.Android.CATEGORY_DEFAULT);

           window.activity.startActivityForResult(intent, function(e) {
                if (e.error) {
                    console.error(e.error);
                } else {
                    try {
                        var videoFile = Ti.Filesystem.getFile(e.intent.data),
                            ffmpeg = require('com.badoque.ffmpeg.android'),
                            outputVideoPath = "",
                            cmd = "-y -i " + videoFile + " -strict experimental -s 160x120 -r 25 -vcodec mpeg4 -b 150k -ab 48000 -ac 2 -ar 22050 " + outputVideoPath; //comand to compress video

                        ffmpeg.execute({
                            cmd: cmd,
                            successCallback: function(e) {
                                console.log(e);
                                //sucesss
                            },
                            errorCallback: function(e) {
                                console.error(e);
                                //error
                            }
                        });

                    } catch (error) {}
                }
            });
[ERROR] FfmpegAndroidWrapperModule: (main) [183,26339] WARNING: linker: /data/user/0/com.GoCatch.app/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
[ERROR] FfmpegAndroidWrapperModule: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
[ERROR] FfmpegAndroidWrapperModule:   built with gcc 4.8 (GCC)
[ERROR] FfmpegAndroidWrapperModule:   configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/i686-linux-android- --arch=x86 --cpu=i686 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/x86 --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -march=i686' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
[ERROR] FfmpegAndroidWrapperModule:   libavutil      55. 17.103 / 55. 17.103
[ERROR] FfmpegAndroidWrapperModule:   libavcodec     57. 24.102 / 57. 24.102
[ERROR] FfmpegAndroidWrapperModule:   libavformat    57. 25.100 / 57. 25.100
[ERROR] FfmpegAndroidWrapperModule:   libavdevice    57.  0.101 / 57.  0.101
[ERROR] FfmpegAndroidWrapperModule:   libavfilter     6. 31.100 /  6. 31.100
[ERROR] FfmpegAndroidWrapperModule:   libswscale      4.  0.100 /  4.  0.100
[ERROR] FfmpegAndroidWrapperModule:   libswresample   2.  0.101 /  2.  0.101
[ERROR] FfmpegAndroidWrapperModule:   libpostproc    54.  0.100 / 54.  0.100
[ERROR] FfmpegAndroidWrapperModule: content://media/external/video/media/3836: Protocol not found
[ERROR] {"error":"WARNING: linker: /data/user/0/com.GoCatch.app/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.\nffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers\n  built with gcc 4.8 (GCC)\n  configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/i686-linux-android- --arch=x86 --cpu=i686 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/x86 --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -march=i686' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=\n  libavutil      55. 17.103 / 55. 17.103\n  libavcodec     57. 24.102 / 57. 24.102\n  libavformat    57. 25.100 / 57. 25.100\n  libavdevice    57.  0.101 / 57.  0.101\n  libavfilter     6. 31.100 /  6. 31.100\n  libswscale      4.  0.100 /  4.  0.100\n  libswresample   2.  0.101 /  2.  0.101\n  libpostproc    54.  0.100 / 54.  0.100\ncontent://media/external/video/media/3836: Protocol not found\n"}
@MahmoudElmoghazy
Copy link
Author

@hugobessa any news ?

@hugobessa
Copy link

@MahmoudElmoghazy the developer of this lib is @Hrfreire. Maybe he can give you a hint

@Hrfreire
Copy link
Collaborator

Hrfreire commented Aug 19, 2017

@MahmoudElmoghazy, the command line must contain the path of video file, not the file itself. The same for the output file.

Example:

var outputVideoName = "compressedVideoFileName.mp3";
var inputVideoFile = videoFile.nativePath;
var outputVideoPath = Ti.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, outputVideoName).nativePath;

var cmd = "-y -i " + inputVideoPath + " -s 576x1024 -strict -2 -ac 1 -ar 16000 -r 13 -ab 32000 -aspect 9:16 -preset ultrafast "+ outputVideoPath;

Then you call ffmpeg.execute. After that, on success callback, you can get the file from the fileSystem.

successCallback: function(e){
	var outputVideo =  Ti.Filesystem.getFile(outputVideoPath);
}

@MahmoudElmoghazy
Copy link
Author

@Hrfreire Thank u for fast response i tried your way but not working and give me the folllowing bug


FfmpegAndroidWrapperModule: (main) [284,82574] WARNING: linker: /data/data/com.GoCatch.app/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
[ERROR] FfmpegAndroidWrapperModule: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
[ERROR] FfmpegAndroidWrapperModule:   built with gcc 4.8 (GCC)
[ERROR] FfmpegAndroidWrapperModule:   configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/i686-linux-android- --arch=x86 --cpu=i686 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/x86 --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -march=i686' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
[ERROR] FfmpegAndroidWrapperModule:   libavutil      55. 17.103 / 55. 17.103
[ERROR] FfmpegAndroidWrapperModule:   libavcodec     57. 24.102 / 57. 24.102
[ERROR] FfmpegAndroidWrapperModule:   libavformat    57. 25.100 / 57. 25.100
[ERROR] FfmpegAndroidWrapperModule:   libavdevice    57.  0.101 / 57.  0.101
[ERROR] FfmpegAndroidWrapperModule:   libavfilter     6. 31.100 /  6. 31.100
[ERROR] FfmpegAndroidWrapperModule:   libswscale      4.  0.100 /  4.  0.100
[ERROR] FfmpegAndroidWrapperModule:   libswresample   2.  0.101 /  2.  0.101
[ERROR] FfmpegAndroidWrapperModule:   libpostproc    54.  0.100 / 54.  0.100
[ERROR] FfmpegAndroidWrapperModule: content://media/external/video/media/194: Protocol not found
[ERROR] {"error":"WARNING: linker: /data/data/com.GoCatch.app/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.\nffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers\n  built with gcc 4.8 (GCC)\n  configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/i686-linux-android- --arch=x86 --cpu=i686 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/x86 --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -march=i686' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=\n  libavutil      55. 17.103 / 55. 17.103\n  libavcodec     57. 24.102 / 57. 24.102\n  libavformat    57. 25.100 / 57. 25.100\n  libavdevice    57.  0.101 / 57.  0.101\n  libavfilter     6. 31.100 /  6. 31.100\n  libswscale      4.  0.100 /  4.  0.100\n  libswresample   2.  0.101 /  2.  0.101\n  libpostproc    54.  0.100 / 54.  0.100\ncontent://media/external/video/media/194: Protocol not found\n"}

@MahmoudElmoghazy
Copy link
Author

@Hrfreire do you have any application example for this module :)

@MahmoudElmoghazy
Copy link
Author

@Hrfreire Any updates :) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants