{"action":"created","issue":{"url":"https://api.github.com/repos/jbavari/cordova-plugin-video-editor/issues/64","repository_url":"https://api.github.com/repos/jbavari/cordova-plugin-video-editor","labels_url":"https://api.github.com/repos/jbavari/cordova-plugin-video-editor/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/jbavari/cordova-plugin-video-editor/issues/64/comments","events_url":"https://api.github.com/repos/jbavari/cordova-plugin-video-editor/issues/64/events","html_url":"https://github.com/jbavari/cordova-plugin-video-editor/issues/64","id":134262344,"number":64,"title":"transcodeVideo error in version 1.0.6","user":{"login":"glauconsantana","id":16944349,"avatar_url":"https://avatars.githubusercontent.com/u/16944349?v=3","gravatar_id":"","url":"https://api.github.com/users/glauconsantana","html_url":"https://github.com/glauconsantana","followers_url":"https://api.github.com/users/glauconsantana/followers","following_url":"https://api.github.com/users/glauconsantana/following{/other_user}","gists_url":"https://api.github.com/users/glauconsantana/gists{/gist_id}","starred_url":"https://api.github.com/users/glauconsantana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glauconsantana/subscriptions","organizations_url":"https://api.github.com/users/glauconsantana/orgs","repos_url":"https://api.github.com/users/glauconsantana/repos","events_url":"https://api.github.com/users/glauconsantana/events{/privacy}","received_events_url":"https://api.github.com/users/glauconsantana/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-17T12:07:38Z","updated_at":"2016-02-17T13:56:58Z","closed_at":null,"body":"On Android, transcodeVideo with maintainAspectRatio = true generates the mp4 file, but corrupted.\r\nWith maintainAspectRatio = false works fine, but I need maintainAspectRatio.\r\n\r\nSorry my poor english.\r\n\r\nAndroid 4.4.2 and 5.0.2\r\nCordova 5.4.0, 5.4.1 and 6.0\r\n\r\nlog:\r\nD/VideoEditor( 5308): shellOut: ffmpeg version N-78332-g14bf59c Copyright (c) 2000-2016 the FFmpeg developers\r\nD/VideoEditor( 5308): shellOut:   built with gcc 4.8 (GCC)\r\nD/VideoEditor( 5308): shellOut:   configuration: --target-os=linux --cross-prefix=/var/www/html/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/var/www/html/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-libmp3lame --enable-libfdk-aac --enable-libopus --enable-libvorbis --enable-gpl --enable-nonfree --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --enable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/var/www/html/ffmpeg-android/ffmpeg-pkg-config --prefix=/var/www/html/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/var/www/html/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/var/www/html/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=\r\nD/VideoEditor( 5308): shellOut:   libavutil      55. 17.100 / 55. 17.100\r\nD/VideoEditor( 5308): shellOut:   libavcodec     57. 24.101 / 57. 24.101\r\nD/VideoEditor( 5308): shellOut:   libavformat    57. 24.101 / 57. 24.101\r\nD/VideoEditor( 5308): shellOut:   libavdevice    57.  0.101 / 57.  0.101\r\nD/VideoEditor( 5308): shellOut:   libavfilter     6. 28.100 /  6. 28.100\r\nD/VideoEditor( 5308): shellOut:   libswscale      4.  0.100 /  4.  0.100\r\nD/VideoEditor( 5308): shellOut:   libswresample   2.  0.101 /  2.  0.101\r\nD/VideoEditor( 5308): shellOut:   libpostproc    54.  0.100 / 54.  0.100\r\nI/MediaStoreImporter( 6037): Update: incremental Added music: 0 Updated music: 0 Deleted music: 0 Created playlists: 0 Updated playlists: 0 Deleted playlists: 0 Inserted playlist items: 0 Deleted playlist items: 0 Removed orphaned playlist items: 0\r\nD/MusicLifecycle( 6037): com.google.android.music.wear.WearBroadcastReceiver generated event: Broadcast received with context android.app.ReceiverRestrictedContext@26814d32 and intent Intent { act=com.google.android.music.IMPORT_COMPLETE flg=0x10 cmp=com.google.android.music/.wear.WearBroadcastReceiver }\r\nD/ActivityManager(  805): startService callerProcessName:com.google.android.music, calleePkgName: com.google.android.music\r\nD/ActivityManager(  805): retrieveServiceLocked(): component = com.google.android.music/com.google.android.music.wear.WearMetadataSyncService; callingUser = 0; userId(target) = 0\r\nD/ActivityManager(  805): caller:android.app.ApplicationThreadProxy@39fe89cd, r.packageName :com.google.android.music\r\nD/VideoEditor( 5308): shellOut: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Camera/20160217_095633.mp4':\r\nD/VideoEditor( 5308): shellOut:   Metadata:\r\nD/VideoEditor( 5308): shellOut:     major_brand     : mp42\r\nD/VideoEditor( 5308): shellOut:     minor_version   : 0\r\nD/VideoEditor( 5308): shellOut:     compatible_brands: isommp42\r\nD/VideoEditor( 5308): shellOut:     creation_time   : 2016-02-17 11:56:37\r\nD/VideoEditor( 5308): shellOut:   Duration: 00:00:03.33, start: 0.000000, bitrate: 3366 kb/s\r\nD/VideoEditor( 5308): shellOut:     Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x480, 3115 kb/s, 23.83 fps, 24 tbr, 90k tbn, 180k tbc (default)\r\nD/VideoEditor( 5308): shellOut:     Metadata:\r\nD/VideoEditor( 5308): shellOut:       rotate          : 270\r\nD/VideoEditor( 5308): shellOut:       creation_time   : 2016-02-17 11:56:37\r\nD/VideoEditor( 5308): shellOut:       handler_name    : VideoHandle\r\nD/VideoEditor( 5308): shellOut:     Side data:\r\nD/VideoEditor( 5308): shellOut:       displaymatrix: rotation of 90.00 degrees\r\nD/VideoEditor( 5308): shellOut:     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)\r\nD/VideoEditor( 5308): shellOut:     Metadata:\r\nD/MusicLifecycle( 6037): com.google.android.music.store.MediaStoreImportService generated event: Service destroyed\r\nD/VideoEditor( 5308): shellOut:       creation_time   : 2016-02-17 11:56:37\r\nD/VideoEditor( 5308): shellOut:       handler_name    : SoundHandle\r\nD/MusicLifecycle( 6037): com.google.android.music.wear.WearMetadataSyncService generated event: Service created\r\nD/ActivityManager(  805): retrieveServiceLocked(): component = null; callingUser = 0; userId(target) = 0\r\nD/MusicLifecycle( 6037): com.google.android.music.wear.WearMetadataSyncService generated event: Service started with intent Intent { cmp=com.google.android.music/.wear.WearMetadataSyncService }\r\nD/WearableService(21868): callingUid 10007, callindPid: 21868\r\nE/GmsUtils( 6037): Failed to connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}\r\nE/GmsUtils( 6037): Failed to connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}\r\nD/MusicLifecycle( 6037): com.google.android.music.wear.WearMetadataSyncService generated event: Service destroyed\r\nI/ActivityManager(  805): Killing 5451:com.google.android.partnersetup/u0a10 (adj 15): empty #25\r\nD/VideoEditor( 5308): shellOut: [libx264 @ 0xb946e950] height not divisible by 2 (320x427)\r\nD/VideoEditor( 5308): shellOut: Output #0, mp4, to '/storage/emulated/0/Android/data/br.com.suporteinfor.apptome/cache/VID_video.mp4':\r\nD/VideoEditor( 5308): shellOut:   Metadata:\r\nD/VideoEditor( 5308): shellOut:     major_brand     : mp42\r\nD/VideoEditor( 5308): shellOut:     minor_version   : 0\r\nD/VideoEditor( 5308): shellOut:     compatible_brands: isommp42\r\nD/VideoEditor( 5308): shellOut:     Stream #0:0(eng): Video: h264, none, q=2-31, 128 kb/s, 24 fps (default)\r\nD/VideoEditor( 5308): shellOut:     Metadata:\r\nD/VideoEditor( 5308): shellOut:       handler_name    : VideoHandle\r\nD/VideoEditor( 5308): shellOut:       creation_time   : 2016-02-17 11:56:37\r\nD/VideoEditor( 5308): shellOut:       encoder         : Lavc57.24.101 libx264\r\nD/VideoEditor( 5308): shellOut:     Stream #0:1(eng): Audio: aac, 0 channels, 128 kb/s (default)\r\nD/VideoEditor( 5308): shellOut:     Metadata:\r\nD/VideoEditor( 5308): shellOut:       creation_time   : 2016-02-17 11:56:37\r\nD/VideoEditor( 5308): shellOut:       handler_name    : SoundHandle\r\nD/VideoEditor( 5308): shellOut:       encoder         : Lavc57.24.101 aac\r\nD/VideoEditor( 5308): shellOut: Stream mapping:\r\nD/VideoEditor( 5308): shellOut:   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))\r\nD/VideoEditor( 5308): shellOut:   Stream #0:1 -> #0:1 (aac (native) -> aac (native))\r\nD/VideoEditor( 5308): shellOut: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height\r\nD/VideoEditor( 5308): ffmpeg finished\r\nD/VideoEditor( 5308): execute method starting\r\nD/VideoEditor( 5308): createThumbnail firing\r\nD/VideoEditor( 5308): options: {\"fileUri\":\"\\/storage\\/emulated\\/0\\/Android\\/data\\/br.com.suporteinfor.apptome\\/cache\\/VID_video.mp4\",\"outputFileName\":\"thumbVideo\",\"atTime\":1,\"quality\":80}\r\nE/Vold    (  237): Failed to find mounted volume for /storage/extSdCard/Android/data/br.com.suporteinfor.apptome/cache/\r\nW/Vold    (  237): Returning OperationFailed - no handler for errno 0\r\nW/ContextImpl( 5308): Failed to ensure directory: /storage/extSdCard/Android/data/br.com.suporteinfor.apptome/cache\r\nE/wpa_supplicant( 1494): IAPP SNAP_HDR Mismatch\r\nE/wpa_supplicant( 1494): IAPP SNAP_HDR Mismatch\r\nD/VideoEditor( 5308): shellOut: /data/data/br.com.suporteinfor.apptome/app_bin/ffmpeg -y -ss 1 -i /storage/emulated/0/Android/data/br.com.suporteinfor.apptome/cache/VID_video.mp4 -vframes 1 -q:v 5 /storage/emulated/0/Android/data/br.com.suporteinfor.apptome/cache/PIC_thumbVideo.jpg \r\nD/VideoEditor( 5308): shellOut: ffmpeg version N-78332-g14bf59c Copyright (c) 2000-2016 the FFmpeg developers\r\nD/VideoEditor( 5308): shellOut:   built with gcc 4.8 (GCC)\r\nD/VideoEditor( 5308): shellOut:   configuration: --target-os=linux --cross-prefix=/var/www/html/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/var/www/html/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-libmp3lame --enable-libfdk-aac --enable-libopus --enable-libvorbis --enable-gpl --enable-nonfree --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --enable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/var/www/html/ffmpeg-android/ffmpeg-pkg-config --prefix=/var/www/html/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/var/www/html/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/var/www/html/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=\r\nD/VideoEditor( 5308): shellOut:   libavutil      55. 17.100 / 55. 17.100\r\nD/VideoEditor( 5308): shellOut:   libavcodec     57. 24.101 / 57. 24.101\r\nD/VideoEditor( 5308): shellOut:   libavformat    57. 24.101 / 57. 24.101\r\nD/VideoEditor( 5308): shellOut:   libavdevice    57.  0.101 / 57.  0.101\r\nD/VideoEditor( 5308): shellOut:   libavfilter     6. 28.100 /  6. 28.100\r\nD/VideoEditor( 5308): shellOut:   libswscale      4.  0.100 /  4.  0.100\r\nD/VideoEditor( 5308): shellOut:   libswresample   2.  0.101 /  2.  0.101\r\nD/VideoEditor( 5308): shellOut:   libpostproc    54.  0.100 / 54.  0.100\r\nD/VideoEditor( 5308): shellOut: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb921f1a0] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!\r\nD/VideoEditor( 5308): shellOut: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb921f1a0] moov atom not found\r\nD/VideoEditor( 5308): shellOut: /storage/emulated/0/Android/data/br.com.suporteinfor.apptome/cache/VID_video.mp4: Invalid data found when processing input\r\nD/VideoEditor( 5308): processComplete: 1\r\nD/VideoEditor( 5308): ffmpeg finished\r\nD/VideoEditor( 5308): execute method starting\r\nD/VideoEditor( 5308): getVideoInfo firing\r\nD/VideoEditor( 5308): options: {\"fileUri\":\"file:\\/storage\\/emulated\\/0\\/Android\\/data\\/br.com.suporteinfor.apptome\\/cache\\/VID_video.mp4\"}\r\nD/VideoEditor( 5308): videoSrcPath: /storage/emulated/0/Android/data/br.com.suporteinfor.apptome/cache/VID_video.mp4\r\nV/MediaPlayerService(  259): Create new media retriever from pid 5308\r\nE/MetadataRetrieverClient(  259): offset (0) bigger than file size (0)\r\nE/PluginManager( 5308): Uncaught exception from plugin\r\nE/PluginManager( 5308): java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA"},"comment":{"url":"https://api.github.com/repos/jbavari/cordova-plugin-video-editor/issues/comments/185214514","html_url":"https://github.com/jbavari/cordova-plugin-video-editor/issues/64#issuecomment-185214514","issue_url":"https://api.github.com/repos/jbavari/cordova-plugin-video-editor/issues/64","id":185214514,"user":{"login":"rossmartin","id":2498502,"avatar_url":"https://avatars.githubusercontent.com/u/2498502?v=3","gravatar_id":"","url":"https://api.github.com/users/rossmartin","html_url":"https://github.com/rossmartin","followers_url":"https://api.github.com/users/rossmartin/followers","following_url":"https://api.github.com/users/rossmartin/following{/other_user}","gists_url":"https://api.github.com/users/rossmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/rossmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossmartin/subscriptions","organizations_url":"https://api.github.com/users/rossmartin/orgs","repos_url":"https://api.github.com/users/rossmartin/repos","events_url":"https://api.github.com/users/rossmartin/events{/privacy}","received_events_url":"https://api.github.com/users/rossmartin/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T13:56:58Z","updated_at":"2016-02-17T13:56:58Z","body":"Hmmm this is odd, it looks like the ffmpeg scale is calculating the height incorrect.\r\n\r\n`height not divisible by 2 (320x427)`\r\n\r\nHave you tried passing different width and height (specifically width as it is used in the scale command).\r\n\r\nHere is the relevant code on android - \r\n\r\n```\r\nif (maintainAspectRatio) {\r\n    clipOut.videoFilter = \"scale=\" + outputWidth + \":-1\";\r\n} else {\r\n    clipOut.width = outputWidth;\r\n    clipOut.height = outputHeight;\r\n}\r\n```\r\n\r\nPlease try width = 640 and height = 640 and let me know if the issue is solved."}}