SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In regards to ffmpeg, you need to make sure you have the "E" next to amr, because that is for the encoding. ffmpeg can decode quite a bit out of the box, but for encoding, many need external codecs.
As far as 3GP, it likely is only needed if you're not using a smartphone. Both Android and iOS have players that can play almost anything (although, I don't believe either has them included in the base install -- you'd have to get them from their respective app stores). VLC is available on both platforms and I use MXPlayer on my Android phones. Although, with MXPlayer, you do need to install an AC3 and DTS codec pack due to licensing issues (I don't think it was allowed to be on the Play Store if it included support for those two formats, so the developer made it available on this xda-developers post. I don't know if VLC has that same limitation.
As far as 3GP, it likely is only needed if you're not using a smartphone.
That is the point of this thread -- I am using a camera and not a smart phone. Regarding the remainder of your post, I am the one sending the videos, thus the burden is on me to send in a format the phone users can use. They are not computer people.
To ensure I have encoding support I installed opencore-amr and rebuilt ffmpeg. After many trial runs I found the following seems to succeed:
That is the point of this thread -- I am using a camera and not a smart phone.
What I meant, is unless you're sending it to non-smartphone users, most should be able to play many of the common formats out there. 3GP seems to have mostly gone away as a default video format for phones... unless they're using the old "dumb phones". For example, my Nexus 6 will record it's videos in an mp4 container using h264 for video and AAC for audio. I imagine most, if not all, smartphones can play back these formats with the default video player.
But I'm glad you were able to convert it. Hopefully your recipients can open it easily.
Originally I thought I needed to convert my camera avi to 3gp. Hence the original post and thread title.
Not a wasted effort. Converting to 3gp reduces the original camera AVI file by about 3x. And I wrote a nice shell script for this.
Turns out though that isn't the actual problem. The problem is iPhone design.
Recently a friend sends me a video from an iPhone 7 to my email address. The video is in 3gp format. Wanting to reciprocate with a video in return and being unfamiliar with iPhones, I presume I need to send videos in the same 3gp format. Wrong guess.
Snooping around the web indicates iPhones are limited to a sliver of video formats.
Currently I am trying to learn how to use ffmpeg to create an iPhone compatible video. Seems there are about 10,000 opinions on how to accomplish this and most don't work. Worse, I am not an ffmpeg guru and do not play one on TV.
I am wondering whether something like Handbrake might be easier. Something that has a simple straightforward option called "Convert to iPhone format." Anything out there like that?
According to a quick google search, this askubuntu answer suggests that handbrake should be able to handle converting to an iphone compatible format easily.
According to a quick google search, this askubuntu answer suggests that handbrake should be able to handle converting to an iphone compatible format easily.
I have been meaning to look at handbrake for a long time. I'm overdue.
That said, I received a short email that (at least) one of the videos I reconverted finally was compatible with the iPhone. I have to wait until tomorrow to learn which one.
When you're sending videos to people that doesn't know anything about videos, using the H.264 codec in a MP4 container is a very good bet. Handbrake is a good start for that, seeing how it'll export only one codec: H.264 in M4V, MP4, and MKV containers.
Exported correctly, H.264/MP4 should be readable by iPhones, other iOS devices, or any other modern media players/devices/computers. I still find devices that would struggle with 1080p materials but not with 720p materials. On a Linux machine, Handbrake, FFMPEG, avconv, VLC, aavidemux, kdenlive, flowblade, basically any program that uses the x264 and AAC libraries will be able to export to H.264/AAC/MP4 format.
From iPhone v5 to iPhone v7, that I am aware of, can handle a decently-quality 720p H264/MP4 natively very well. I think (but I'm not sure) iPhone v4S or lower struggles with 720p media but will handle better with videos at 640x360 or lower.
I get that you probably no longer have a need for the 3GP format, but if you still want to squeeze your H.264/MP4 file size down to an equivalent 3GP file size, then experiment with bitrate. Something like 300kbps (in your first post, the 3GP format is at 133kb\s and the MJPEG/AVI format is 10147kb\s) Reducing screen size to 360x240 or even 128x96 will also reduce the total file size. With FFMPEG (also in Handbrake as 'Quality'), experiment with the '-q:v' flag. '0' is the highest/lossless quality where '31' is the lowest quality. The total size of the audio track are usually insignificant when compared to its video track's total file size, so I often leave it at original or better (128kbps or better; usually at 320kbps). Sometime, I just copy it straight over with '-c:a copy' so it won't re-encode the audio track and thus degrade it further.
Basically, set your desired resolution/screen size, and then bump up (or down) the bitrate/'-q:v' options until you like what you see. Sometime it's necessary to bump up or down the resolution/screen size to preserve the video's quality at the expense of total file size.
Using FFMPEG is an easier task for me. Basically type, enter, done. Occasionally, between the 'type' stage and 'done' stage, there will be three-days worth of online research in finding the right syntax to export a certain codec correctly.
I've found a sample from a Canon G9 and its video format is almost exactly the same as yours.
The good news is the other person finally can see the videos. Previously I had used my new script to create the 3gp and convert to mp4. I manually created mov and m4v from those. No problem with any of those. As I no longer actually need 3gp any more, I plan to update the script to create the same file types directly. I still need the ffmpeg parameters I included in the script because the final file size gets shrunk considerably and converted to 320x240.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.