Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Latest Questions
3
votes
0
answers
98
views
What are the additional data streams in Google Pixels MP4 videos?
Almost by accident I stumpled about 3 additional streams that are stored within the `*.mp4` video files my google Pixle 7a makes. This is what is reported about them ``` [alex@thinkbox ffmpeg]$ nn.ffmpeg -i PXL_20241011_171852306.LS.mp4 |& grep 'Stream #0' Stream #0:0[0x1](eng): Video: hevc (Main) (...
Almost by accident I stumpled about 3 additional streams that are stored within the
I assume there is more info stored in the data streams, yet I this is still unclear and the hope is an answer to this question could provide some insight here :).
*.mp4
video files my google Pixle 7a makes.
This is what is reported about them
[alex@thinkbox ffmpeg]$ nn.ffmpeg -i PXL_20241011_171852306.LS.mp4 |& grep 'Stream #0'
Stream #0:0[0x1](eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 11870 kb/s, SAR 1:1 DAR 16:9, 24.72 fps, 24.75 tbr, 90k tbn (default)
Stream #0:1[0x2](eng): Data: none (mett / 0x7474656D), 1650 kb/s (default)
Stream #0:2[0x3](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
Stream #0:3[0x4](eng): Data: none (mett / 0x7474656D), 89 kb/s (default)
Stream #0:4[0x5](eng): Data: none (mett / 0x7474656D) (default)
I am very curious to know what they are. In particular stream #0:1 with its larger 1650 kb/s
?
I exported the stream to a file that starts like this
[alex@thinkbox ffmpeg]$ xxd stream_data.txt | head -n 30
00000000: 2111 4500 1450 0146 fff1 0a5a 5a5a 5a5a !.E..P.F...ZZZZZ
00000010: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000020: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000030: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000040: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000050: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000060: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000070: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000080: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000090: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
000000a0: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
000000b0: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
000000c0: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
000000d0: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
000000e0: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
000000f0: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000100: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
00000110: 5a5a 5a5a 5a5a 5de5 c214 b4b4 b4b4 b4b4 ZZZZZZ].........
00000120: b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 ................
00000130: b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 ................
00000140: b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 b4b4 ................
00000150: b4b4 b4b4 bc21 1145 0014 5001 46ff f10a .....!.E..P.F...
00000160: 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a 5a5a ZZZZZZZZZZZZZZZZ
I was yet unable to find some insight. Given the nameng "Google and Pixel" it is also kind of challenging to "google" information about "pixel mp4" video files....
## (some) more info ##
I have been able to use adb
and ffmpeg
to do the following:
1. use ffmpeg to remove "data streams"
nn.ffmpeg -i PXL_20241011_171852306.LS.mp4 -map 0 -map -0:d -c copy PXL_20241011_171852306.LS.no.data.mp4
which removed all but the audio and video data.
it reduced the size of the video (21 seconds of FHD resolution) from 37MiB to 32MiB
2. use adb push
to push a)
the created file ....no.data.mp4
and also b)
an exact copy of the original file named ...copy.mp4
back to the Google Pixel 7a
3. On the phone I used the "file manager app" to create two copies of the files inside the /sdcard/Pictures
folder (as only this way the files appeared in the "Google Photos app"
This showed that the copy shows "equal as the original video mp4 file" while the ....no.data.mp4
version has the following differences (prosummed to be hence in the data streams):
* the date the video was taken is gone it is shown by the file modification date (i.e. file's unix mtime
)
* the "Shots available" is gone 
humanityANDpeace
(807 rep)
Oct 12, 2024, 08:41 AM
• Last activity: Oct 12, 2024, 10:35 AM
1
votes
0
answers
348
views
Re-encoding with ffmpeg fails on Android
I have the following command that fails when running on an Android device. I don't think it's related to the overlaying part but to the re-encoding of the video. This same command works perfectly on iOS. ffmpeg -y -i "video-file.mp4" -framerate 60.0 -i "%05d.png" -filter_complex "[0:v][1:v]overlay"...
I have the following command that fails when running on an Android device. I don't think it's related to the overlaying part but to the re-encoding of the video. This same command works perfectly on iOS.
ffmpeg -y -i "video-file.mp4" -framerate 60.0 -i "%05d.png" -filter_complex "[0:v][1:v]overlay" "output-video-file.mp4"
The error that I am getting is the following.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video-file.mp4':
Metadata:
compatible_brands: isommp41mp42
major_brand : mp42
minor_version : 1
creation_time : 2024-01-03T20:44:54.729000Z
encoder : Lavf60.3.100
Duration: 00:00:25.30, start: 0.000000, bitrate: 8586 kb/s
Stream #0:0[0x1](und): Video: hevc (hvc1 / 0x31637668), yuv420p(tv, bt709), 1280x720, 8509 kb/s, 59.91 fps, 60 tbr, 19200 tbn (default)
Metadata:
creation_time : 2024-01-03T20:44:54.000000Z
handler_name : Core Media Video
vendor_id :
Stream #0:1[0x2](und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 kb/s (default)
Metadata:
creation_time : 2024-01-03T20:44:54.000000Z
handler_name : Core Media Audio
vendor_id :
Input #1, image2, from '%05d.png':
Duration: 00:00:01.00, start: 0.000000, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 1280x720, 5 fps, 5 tbr, 5 tbn
Stream mapping:
Stream #0:0 (hevc) -> overlay (graph 0)
Stream #1:0 (png) -> overlay (graph 0)
overlay:default (graph 0) -> Stream #0:0 (h264_mediacodec)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[h264_mediacodec @ 0xb400007a3e6347e0] Use 1 as the default MediaFormat i-frame-interval, please set gop_size properly (>= fps)
[amediacodec @ 0xb400007a1c9427f0] android.media.MediaCodec$CodecException: Error 0xffffffc3
[h264_mediacodec @ 0xb400007a3e6347e0] MediaCodec configure failed, Generic error in an external library
[vost#0:0/h264_mediacodec @ 0xb400007a2c8a4490] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[aac @ 0xb400007a3e85b6a0] Qavg: 169.544
[aac @ 0xb400007a3e85b6a0] 2 frames left in the queue on closing
Catalin Morosan
(111 rep)
Jan 9, 2024, 07:02 AM
• Last activity: Jan 9, 2024, 08:20 AM
1
votes
0
answers
2282
views
Hardware accelerated ffmpeg using MediaCodec on Android?
I've tried running for example `ffmpeg -i 1_5111632628432240784.MP4 -c:v h264_mediacodec -c:a aac -b:v 1M -g 60 test.mp4` in Termux in different variations, which yields an output like this, regardless of whether I specify output bitrate or not: ``` amediacodec_ndk @ 0xb400006fa0cc6980 Encoder confi...
I've tried running for example
ffmpeg -i 1_5111632628432240784.MP4 -c:v h264_mediacodec -c:a aac -b:v 1M -g 60 test.mp4
in Termux in different variations, which yields an output like this, regardless of whether I specify output bitrate or not:
amediacodec_ndk @ 0xb400006fa0cc6980 Encoder configure failed, -10000
[h264_mediacodec @ 0xb400006fa0cd2000] MediaCodec configure failed, Generic error in an external library
[vost#0:0/h264_mediacodec @ 0xb400006fa0cb9300] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
I saw that ffmpeg supports MediaCodec since February 2023: "MediaCodec decoder via NDKMediaCodec, MediaCodec encoder".
The version I have installed is compiled to support it:
ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with Android (9352603, based on r450784d1) clang version 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
configuration: --arch=aarch64 --as=aarch64-linux-android-clang --cc=aarch64-linux-android-clang --cxx=aarch64-linux-android-clang++ --nm=llvm-nm --pkg-config=/home/builder/.termux-build/_cache/android-r25c-api-24-v2/bin/pkg-config --strip=llvm-strip --cross-prefix=aarch64-linux-android- --disable-indevs --disable-outdevs --enable-indev=lavfi --disable-static --disable-symver --enable-cross-compile --enable-gnutls --enable-gpl --enable-version3 --enable-jni --enable-lcms2 --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgme --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenmpt --enable-libopus --enable-librav1e --enable-libsoxr --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-mediacodec --enable-opencl --enable-shared --prefix=/data/data/com.termux/files/usr --target-os=android --extra-libs=-landroid-glob --disable-vulkan --enable-neon --disable-libfdk-aac
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
So my question is, how can I use hardware accelerated video decoding and encoding using ffmpeg on Android in a terminal?
user9279628
(11 rep)
Oct 25, 2023, 08:51 PM
• Last activity: Oct 25, 2023, 10:41 PM
0
votes
0
answers
1051
views
M4A audio files not recognized by Samsung Recorder app
I need to convert my M4A audio files to M4A but with a 3GP4 codec (it seems Samsung audio recording app only recognizes those with a 3GP4 codec). How can I do that with ffmpeg or any other program? I tried: ffmpeg -i input.m4a -brand "3gp4" output.m4a This did change the major brand to 3gp4, but the...
I need to convert my M4A audio files to M4A but with a 3GP4 codec (it seems Samsung audio recording app only recognizes those with a 3GP4 codec).
How can I do that with ffmpeg or any other program?
I tried:
ffmpeg -i input.m4a -brand "3gp4" output.m4a
This did change the major brand to 3gp4, but the Samsung Recorder app still doesn't recognize the audio file.
Ash
(1 rep)
Aug 18, 2023, 07:59 PM
• Last activity: Aug 19, 2023, 07:13 AM
0
votes
0
answers
1128
views
ffmpeg closes with "Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted" in android
I am running FFmpeg in my app and specifically in "Android 11" I am getting this error from several users I have researched a lot but no solution found. I thought there is something wrong with the codec parameter that is being passed since it is saying "incorrect codec parameters" but most of the pa...
I am running FFmpeg in my app and specifically in "Android 11" I am getting this error from several users
I have researched a lot but no solution found.
I thought there is something wrong with the codec parameter that is being passed since it is saying "incorrect codec parameters" but most of the parameters looks good.
also verified if all the required file permission are granted and those are good too
now I m unable to find the problem,
please help, thanks
Command:
/data/app/~~hyrHVcslcfdQcguX0rauRA==/-QbDCul7FXU4tVniSDeP1Sg==/lib/arm64/libffmpeg.so -i /storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Video/VID-20220414-WA0010.mp4 -c:v libx264 -crf 23 -map 0:V -map 0:a? -map 0:s? -c:s mov_text -segment_time 26 -g 26 -sc_threshold 0 -force_key_frames expr:gte(t,n_forced*26) -reset_timestamps 1 -f segment -preset ultrafast /storage/emulated/0/Movies/splitVideoFolder/split_video%03d.mp4
Error:
ffmpeg version v4.4-dev-416 Copyright (c) 2000-2020 the FFmpeg developers
built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
configuration: --cross-prefix=aarch64-linux-android- --sysroot=/Users/admin/AndroidStudioProjects/android-ndk-r21d/toolchains/llvm/prebuilt/darwin-x86_64/sysroot --prefix=/Users/admin/AndroidStudioProjects/Tanner/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/local/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android21-clang --cxx=aarch64-linux-android21-clang++ --extra-libs='-L/Users/admin/AndroidStudioProjects/Tanner/mobile-ffmpeg/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-shared --disable-ffplay --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libass --enable-iconv --enable-libx264 --enable-gpl --disable-sdl2 --enable-zlib --enable-mediacodec
libavutil 56. 55.100 / 56. 55.100
libavcodec 58. 96.100 / 58. 96.100
libavformat 58. 48.100 / 58. 48.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Video/VID-20220414-WA0010.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
Duration: 00:01:30.53, start: 0.000000, bitrate: 671 kb/s
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 576x1024 [SAR 1:1 DAR 9:16], 539 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0xb400007727c64800] using SAR=1/1
[libx264 @ 0xb400007727c64800] using cpu capabilities: ARMv8 NEON
[libx264 @ 0xb400007727c64800] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
[libx264 @ 0xb400007727c64800] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=26 keyint_min=2 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
[segment @ 0xb400007727c28800] Opening '/storage/emulated/0/Movies/splitVideoFolder/split_video000.mp4' for writing
[segment @ 0xb400007727c28800] Failed to open segment '/storage/emulated/0/Movies/splitVideoFolder/split_video000.mp4'
Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
Error initializing output stream 0:0 --
[aac @ 0xb400007727c65700] Qavg: 18220.703
[aac @ 0xb400007727c65700] 2 frames left in the queue on closing
Conversion failed!
Tani Nagpal
Apr 27, 2022, 10:46 AM
• Last activity: Apr 27, 2022, 12:40 PM
0
votes
0
answers
291
views
Is it possible to record MJPEG directly on Android?
Is it possible to record video from an android camera directly as MJPEG? I am interested in MJPEG for quality purposes. I don't want to record video via default android settings and then convert to MJPEG, but directly from the camera device as MJPEG. Is this possible? I can't find any information su...
Is it possible to record video from an android camera directly as MJPEG? I am interested in MJPEG for quality purposes. I don't want to record video via default android settings and then convert to MJPEG, but directly from the camera device as MJPEG. Is this possible? I can't find any information suggesting this is possible.
connor449
(111 rep)
Apr 5, 2021, 04:34 PM
• Last activity: Apr 5, 2021, 08:09 PM
1
votes
1
answers
714
views
Compress a video for android using ffmpeg
I'm trying to compress a video to send it around in a messenger. Normally I would use something like ``` ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4 ``` but if I send it around in a messenger app like telegram afterwards, I can only watch it on my PC but not my smartphone (I tested differ...
I'm trying to compress a video to send it around in a messenger. Normally I would use something like
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
but if I send it around in a messenger app like telegram afterwards, I can only watch it on my PC but not my smartphone (I tested different devices) although the codec is said to be supported: [https://developer.android.com/guide/topics/media/media-formats](https://developer.android.com/guide/topics/media/media-formats)
What is the best way to compress a video for messengers in mobile devices?
TheIdealis
(111 rep)
Nov 11, 2020, 01:27 PM
• Last activity: Jan 17, 2021, 12:01 AM
1
votes
0
answers
399
views
FFmpeg Two-Pass Encoding in Android
According to the documentation for using Two-Pass method we have to run ffmpeg twice like this: ffmpeg -y -i input -c:v libx264 -b:v 2600k -pass 1 -an -f mp4 /dev/null && \ ffmpeg -i input -c:v libx264 -b:v 2600k -pass 2 -c:a aac -b:a 128k output.mp4 But When I use these codes I get this error: Unab...
According to the documentation for using Two-Pass method we have to run ffmpeg twice like this:
ffmpeg -y -i input -c:v libx264 -b:v 2600k -pass 1 -an -f mp4 /dev/null && \
ffmpeg -i input -c:v libx264 -b:v 2600k -pass 2 -c:a aac -b:a 128k output.mp4
But When I use these codes I get this error:
Unable to find a suitable output format for '&&'
And Android doesn't recognize
"&& \"
as an argument for ffmpeg or ffmpeg doesn't recognize such a thing on Android!
Could somebody tell me how I should do 2-Pass encoding on Android with FFmpeg?
MSH
Dec 22, 2018, 06:51 AM
• Last activity: Jun 23, 2019, 12:55 PM
4
votes
1
answers
17188
views
Fast Video Compression on Android
I want to upload video files to server and compress before uploading. I'm using ffmpeg libx264. I have seen viber can upload 30 second video file of size 32MB within a minute [reduce it's down to 2.3MB]. I want to know how do they do it so fast? What I have tried so far - FFMPEG version : n2.4.2 Bui...
I want to upload video files to server and compress before uploading. I'm using ffmpeg libx264. I have seen viber can upload 30 second video file of size 32MB within a minute [reduce it's down to 2.3MB]. I want to know how do they do it so fast?
What I have tried so far -
FFMPEG version : n2.4.2
Built with gcc 4.8
Build Configuraiton : --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --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/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
Command:
ffmpeg -y -i /storage/emulated/0/main.mp4 -s 480x320 -r 20 -c:v libx264 -preset ultrafast -c:a copy -me_method zero -tune fastdecode -tune zerolatency -strict -2 -b:v 1000k -pix_fmt yuv420p /storage/emulated/0/output.mp4
The result so far is, a 30second 78MB file gets compressed to 4.3MB which takes around 1min 28seconds. Here is the console dump - http://pastebin.com/rn81acGx . I mainly want to reduce the time it takes to compress. How can I achieve this?
Thanks in advance.
Asif Aminur Rashid
(141 rep)
Oct 29, 2015, 08:56 AM
• Last activity: Sep 21, 2017, 11:02 AM
0
votes
1
answers
156
views
Unsure why Android has issues with certain Opus files
I'm not 100% sure where to post this cause it's kind of a strange issue. I recently discovered the Opus format and converted all my songs to it, so they would fit on my phone. However a few cd's I've converted from MP3 to Opus are having a strange issue. I did have to rename all the files from .opus...
I'm not 100% sure where to post this cause it's kind of a strange issue. I recently discovered the Opus format and converted all my songs to it, so they would fit on my phone. However a few cd's I've converted from MP3 to Opus are having a strange issue. I did have to rename all the files from .opus to .ogg so they could be read by media players, but what's odd is that some of the cd's I've converted seem to lose their information when I copy them over to my device (Nexus 6 running 7.1.1).
Like, all the tag information is gone and every media player that's able to see it says the song is 00:00 in time. Yet when I actually play the song, it works totally fine. I can't even edit the tag information in any apps because it just disappears. Is there any reason it would do this? I've tried re-converting the songs a few times but the same problem still happens.
allengar
(1 rep)
Mar 10, 2017, 05:25 AM
• Last activity: Mar 12, 2017, 05:13 AM
1
votes
0
answers
1260
views
Which ffmpeg command allow me to record sound?
`ffmpeg` can be installed through termux by installing the package `mpv`: $ apt-get install mpv Now, on linux, I record sound with the command ffmpeg -f alsa -ac 2 -i plughw:0,0 recording.mp3 This commnand does not work on android for me. What would be the right `-f` flag argument? **What is the ffm...
ffmpeg
can be installed through termux by installing the package mpv
:
$ apt-get install mpv
Now, on linux, I record sound with the command
ffmpeg -f alsa -ac 2 -i plughw:0,0 recording.mp3
This commnand does not work on android for me. What would be the right -f
flag argument?
**What is the ffmpeg command to record sound from the terminal on android?**
user123456
(337 rep)
Feb 8, 2017, 03:10 PM
• Last activity: Feb 9, 2017, 10:48 AM
1
votes
1
answers
2756
views
Cannot install ffmpeg with Termux
Why do I get a `404 Not Found [IP: 104.18.36.234 80]` after attempting to install `ffmpeg`? # apt-install ffmpeg Reading package lists... Building dependency tree... Reading state information... The following additional packages will be installed: libbz2 libopus libx264 xvidcore The following NEW pa...
Why do I get a
404 Not Found [IP: 104.18.36.234 80]
after attempting to install ffmpeg
?
# apt-install ffmpeg
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
libbz2 libopus libx264 xvidcore
The following NEW packages will be installed:
ffmpeg libbz2 libopus libx264 xvidcore
0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.
Need to get 5595 kB/6094 kB of archives.
After this operation, 19.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] Err:1 http://termux.net stable/main arm ffmpeg arm 3.1.3-1
404 Not Found [IP: 104.18.36.234 80]
The ip can be reached with ping
and with a browser (link )
It is written Direct IP access not allowed
is displayed on the page but that is normal since only apt
from Termux
may be allowed.
user123456
(337 rep)
Oct 7, 2016, 01:52 PM
• Last activity: Oct 7, 2016, 03:05 PM
0
votes
0
answers
681
views
Ffmpeg on non-rooted Android?
I've set several places where I can get a ffmpeg binary for Android, but I cannot seem to run it. I use the . command to run shell scripts, but not ffmpeg. Is there any way at all I can run ffmpeg without rooting my device? (chmod-ing it is not allowed.) I've downloaded a binary before, and attempte...
I've set several places where I can get a ffmpeg binary for Android, but I cannot seem to run it. I use the . command to run shell scripts, but not ffmpeg. Is there any way at all I can run ffmpeg without rooting my device? (chmod-ing it is not allowed.)
I've downloaded a binary before, and attempted to run it, but I was unable to do so because it was not marked as executable. I was not allowed to chmod it and received the following error:
Unable to chmod file: operation not permitted
.
Nonny Moose
(135 rep)
Sep 29, 2016, 12:28 PM
• Last activity: Sep 30, 2016, 06:03 PM
5
votes
1
answers
624
views
How can I convert my music to show up OGG Vorbis tags?
What command with FFmpeg should I use to ensure that all of my metadata (Currently, most of the Artist tags are ignored) and music will play perfectly on Android? (Preferably using Ogg Vorbis!) I'm running the latest stable version of CyanogenMod (7.1) but the majority shows up under "Unknown Artist...
What command with FFmpeg should I use to ensure that all of my metadata (Currently, most of the Artist tags are ignored) and music will play perfectly on Android? (Preferably using Ogg Vorbis!)
I'm running the latest stable version of CyanogenMod (7.1) but the majority shows up under "Unknown Artist" on my device, but shows them on the computer. I just use Banshee to sync the music, as I'm a linux user (so DoubleTwist is not a solution ;__;)
Joe Simpson
(161 rep)
Sep 29, 2011, 07:20 PM
• Last activity: Jun 30, 2014, 06:40 AM
1
votes
1
answers
6374
views
ffmpeg - Permission denied when running binary, even as root
I've compiled ffmpeg for Android with the NDK and transferred the compiled binary to /data/local, but when I try to execute the binary, even as su, the terminal returns 'Permission denied.' The configure script I use for ffmpeg is: NDK=/home/adam/ndk/android-ndk-r9c PLATFORM=$NDK/platforms/android-1...
I've compiled ffmpeg for Android with the NDK and transferred the compiled binary to /data/local, but when I try to execute the binary, even as su, the terminal returns 'Permission denied.'
The configure script I use for ffmpeg is:
NDK=/home/adam/ndk/android-ndk-r9c
PLATFORM=$NDK/platforms/android-19/arch-arm
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64
./configure --target-os=linux --arch=arm --enable-cross-compile --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- --sysroot=$PLATFORM --enable-pic --enable-runtime-cpudetect
ls -l ffmpeg
outputs:
-rw-rw-rw- root root 10338136 2013-12-30 15:54 ffmpeg
Adam Chance
(113 rep)
Dec 30, 2013, 04:20 PM
• Last activity: Dec 30, 2013, 05:11 PM
5
votes
1
answers
4621
views
FFMpeg stream to FFServer from Back Camera
I'm looking for a way to stream my camera video from my Android phone to an FFServer, like I would with FFMpeg from the command line in Linux: ffmpeg -f video4linux2 -i /dev/video0 http://IP:8090/cam1.ffm This command works perfect from any Ubuntu machine, of course. I'm looking to be able to do bot...
I'm looking for a way to stream my camera video from my Android phone to an FFServer, like I would with FFMpeg from the command line in Linux:
ffmpeg -f video4linux2 -i /dev/video0 http://IP:8090/cam1.ffm
This command works perfect from any Ubuntu machine, of course. I'm looking to be able to do both audio and video from my Android to my FFserver.
I tried installing FFmpeg 4 Android . It installs fine, starts and binds, but it won't stream. No error message or anything passing it this param:
ffmpeg -f video4linux2 -i /dev/graphics/fb0 http://IP:8090/cam1.ffm
Not sure if it's just that program or what since there is no error message at all. Or is there another software that will allow me to do this?
jfreak53
(240 rep)
Dec 19, 2012, 01:14 AM
• Last activity: Mar 21, 2013, 09:48 PM
3
votes
5
answers
3325
views
Ffmpeg options for Android?
What ffmpeg options should I use to make video playable on Android Phone (specifically, LG Optimus)? I tried various bitrate and codecs and all combinations I came up with doesn't work (tried theora, mpeg4, h264).
What ffmpeg options should I use to make video playable on Android Phone (specifically, LG Optimus)? I tried various bitrate and codecs and all combinations I came up with doesn't work (tried theora, mpeg4, h264).
Kuroki Kaze
(123 rep)
Jan 17, 2011, 01:22 PM
• Last activity: Apr 5, 2011, 07:55 PM
3
votes
3
answers
4862
views
The video file cannot be played
I have new android tablet (Archos 7) and lot of video files are not playable. The program ends with message "The video file cannot be played". The file type is avi, which is normally playble (I played many other videos). The videos which are not playble in tablet, are playble on my laptop (with Ubun...
I have new android tablet (Archos 7) and lot of video files are not playable. The program ends with message "The video file cannot be played". The file type is avi, which is normally playble (I played many other videos). The videos which are not playble in tablet, are playble on my laptop (with Ubuntu). Is it possible to make the videos playble on tablet?
E.g. to convert them with ffmpeg to another form which will be playble, or is there some repair mechanism in Android?
I tried another player Act 1 Video Player, but that didn't help.
thank you for help
xralf
(47 rep)
Mar 15, 2011, 10:07 AM
• Last activity: Mar 15, 2011, 11:18 PM
Showing page 1 of 18 total questions