David Graham
Forum Replies Created
-
Sorry that I have taken so long to reply, I was hoping to contribute something more useful so I have been trying some stuff first. I fear your samples didn’t work for what I wanted but I appreciate your time making them available to me. In the end I succeeded using handbrake with web optimise (I think this sets up the moov atom) and also with Winff. With ffmpeg you need to run qt-faststart to get the moov atom in the right place. However this worked for what I wanted but I think that there are a lot of possible variations for different platforms. However even after lots of tries I could not get it to work on the Linux command line as I had wanted but I have learnt a lot from poking around. I have given up now but I suspect it is all in the ffmpeg compilation – maybe I needed to use an older version for what I wanted.
Here is a list of links that I found useful:
https://www.broken-links.com/2010/07/30/encoding-video-for-android/
https://help.ubuntu.com/community/AndroidVideoEncoding
https://ffmpeg.org/ffmpeg.html
https://developer.android.com/guide/appendix/media-formats.html
https://h264.code-shop.com/trac/wiki/Encoding
https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping
https://can.homeunix.org/sw/psp/ffmpeg_psp/
https://ffmpeg.arrozcru.org/autobuilds/
https://ubuntuforums.org/showpost.php?p=10671718&postcount=1606
https://androidcommunity.com/forums/f41/new-updated-video-encoder-for-g1-6185/index3.html#post88879
https://www.penguin.cz/~utx/amr
https://www.linuxquestions.org/questions/linux-mobile-81/android-g1-and-video-converted-via-ffmpeg-h263-687163/
https://help.ubuntu.com/community/iPodVideoEncoding
https://linux.justinhartman.com/FFmpeg,_FFmpeg-PHP,_Lame,_Libogg,_Libvorbis,_FLVtool2,_Mplayer,_Mencoder,_AMR_Installation
https://ffmpeg.org/
https://ubuntuforums.org/showthread.php?t=786095
https://www.linuxfromscratch.org/blfs/view/6.3/multimedia/xvid.html
https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide
https://flowplayer.org/demos/scripting/fallback.html
https://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs -
I have given your solution a try and it does work but still not with my Android device. However from the output when ffmpeg was running, I did notice some errors (marked in orange) that self corrected. You can see the results under test 3 at https://ffmpeg.play4gain.com. I have not compiled my ffmpeg for a number of weeks so I have forgotten how the configuration worked but I am wondering if I am lacking some components that make the difference. Would you mind downloading the avi clip and building the mp4 video under your configuration and letting me have a copy of the mp4 file together with the output from ffmpeg to try. If it works, I can hopefully recompile my ffmpeg source with your configuration and get a result. My avi clip is at https://ffmpeg.play4gain.com/jump247-1.avi
Many thanks in advance,
Dave
-
Hi Michael,
Thank you very much for your response. I think you have found the problem. In my second test – H.264 (MPEG-4 AVC). Command line below (hoping it may help others), according to your link is only good for Android 3.0 +
ffmpeg -i jump247-1.avi -s 720×400 -b 384k -vcodec libx264 -flags +loop+mv4 -cmp 256 -partitions
+parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -subq 7 -trellis 1 -refs 5 -bf 0 -flags2 +mixed_refs
-coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51
-qdiff 4 -strict experimental -acodec aac H.264-MPEG-4-AVC.mp4From your link, it looks to me like I could build my video using H.263 as both the encoders and decoders have been included in my ffmpeg build. I am a real novice when it comes to media formats and encoding so can you suggest a command line? I note that H.263 only supports the following sizes: 128×96, 176×144, 352×288, 704×576, and 1408×1152.
I guess a video bitrate between 56 Kbps and 500 Kbps -b (384k worked before).
and a frame rate of 30 because I think that will be the same as the source video.
Audio perhaps: -strict experimental -acodec aac
Other gobbledygook is beyond the scope of my knowledge 🙂So I think that I need to start like this:
ffmpeg -i jump247-1.avi -s 352×288 -b 384k -r 30 -vcodec h263 -strict experimental -acodec aac H.264-MPEG-4-AVC.mp4If I run this I get an error message: “incorrect codec parameters”
It also says “could not find tag, codec not currently supported in container” , any suggestions?
Thanks in advance,
Dave
output below:
ffmpeg version 0.8.2.git, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 6 2011 14:01:03 with gcc 4.4.4 20100726 (Red Hat 4.4.4-13)
configuration: –enable-libfaac –enable-libx264 –enable-gpl –enable-nonfree –enable-postproc –enable-pthreads –enable-shared –enable-libxvid –enable-x11grab –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libmp3lame –enable-libfaac –enable-decoder=h263 –enable-encoder=h263 –enable-decoder=h264 –enable-encoder=h264 –enable-version3
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 11. 0 / 53. 11. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[avi @ 0x2312780] parser not found for codec pcm_s16le, packets or times may be invalid.
[avi @ 0x2312780] parser not found for codec dvvideo, packets or times may be invalid.
Input #0, avi, from ‘jump247-1.avi’:
Duration: 00:00:06.63, start: 0.000000, bitrate: 30318 kb/s
Stream #0.0: Video: dvvideo (dvsd / 0x64737664), yuv411p, 720×480 [SAR 32:27 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc
Stream #0.1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2 channels, s16, 1536 kb/s
File ‘H.264-MPEG-4-AVC.mp4’ already exists. Overwrite ? [y/N] y
Incompatible pixel format ‘yuv411p’ for codec ‘h263’, auto-selecting format ‘yuv420p’
[buffer @ 0x2317860] w:720 h:480 pixfmt:yuv411p tb:1/1000000 sar:32/27 sws_param:
[scale @ 0x237e3a0] w:720 h:480 fmt:yuv411p -> w:352 h:288 fmt:yuv420p flags:0x4
[mp4 @ 0x23154c0] track 0: could not find tag, codec not currently supported in container
Output #0, mp4, to ‘H.264-MPEG-4-AVC.mp4’:
Metadata:
encoder : Lavf53.11.0
Stream #0.0: Video: h263, yuv420p, 352×288 [SAR 16:11 DAR 16:9], q=2-31, 384 kb/s, 90k tbn, 30 tbc
Stream #0.1: Audio: aac (@[0][0][0] / 0x0040), 48000 Hz, 2 channels, s16, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0 (dvvideo -> h263)
Stream #0.1 -> #0.1 (pcm_s16le -> aac)
Could not write header for output file #0 (incorrect codec parameters ?)