FFmpeg

Why decoding AAC with ffmpeg doesn't work...

This blog post helped me a lot with my AAC decoding issue and was not popping up in my first couple of Google searches. The fix for the "Error while decoding stream #0.0" messages to decode one of my AAC streams was (as descibed by llando on the linked page) to use the "libfaad" library for decoding the input stream. Eg.:
ffmpeg -acodec libfaad -i myfile.mp4 -f flv -vcodec flv -acodec libmp3lame -b 800k -ar 44100 -ab 64k -ac 2 -s 400x224 myfile.flv

Encoding TV recordings from a DVD into MPEG-4 or H.264 with HandBrake

We've a desktop DVD recorder with a built-in TV tuner and a hard disk as a substitute for the old VCR technology. Sometimes I've to create a video from such TV rips, either in MPEG-4 or H.264 format. Since this recorder has no digital output (like an USB or Firewire connector), we used to copy the titles to a rewritable DVD disc and I recode the contents with HandBrake on my Mac. I'll put down now the parameters that I've found to produce a good result. These are by no means "the" optimal parameters, I'm just saving them for future reference and in case somebody else might profit from it.

Videos shared to Facebook and images/thumbnails generated with ffmpeg

If you share a video on Facebook, the thumbnail image of the video does not come directly from the website that is hosting the video itself. Facebook uses a wrapper script called safe_image.php to serve images from external webservers. The same is true if you share the link of an image. The problem is that this wrapper script does not accept all JPEG files, but only ones that have a JFIF header.

Downsampling multichannel audio (5.1) into stereo (2 channels) with ffmpeg

I googled quite a bit to find patches for ffmpeg that will allow conversion from 5.1 audio channels into stereo. This is necessary if you want to convert all sorts of videos into FLVs with mp3 audio channel (eg. if you operate a video streaming service), since mp3 supports only mono and stereo channels.

Extracting thumbnails (still images / frames) from a video with FFmpeg

Extracting all frames from the video:
ffmpeg -i input.avi -f image2 frame-%05d.png
This will create files like frame-00001.png, frame-00002.png, etc.

Extracting a single frame is easy too:
ffmpeg -i input.avi -f image2 -ss 14.342 -vframes 1 frame.png
This will save the frame that is at 14.342s. The fractions in the offset (-ss) are good for specifying the frame within a second.

Fixing Flash videos (FLV) for use with Adobe Flash Media Server (FMS)

Using Adobe Flash Media Server to stream Flash videos (FLVs) you might hit on the following error messages:
  • In FMS's core.00.log:
    2008-12-18      00:33:55        3687    (w)2611179      Warning from libflv.so: File contains bad meta data : /opt/adobe/fms/applications/vod/media/somedir/200812171225_327.flv (TCFLVData.cpp:490). -
  • In the output of flvcheck (a utility shipped with FMS in the tools subdirectory to check FLVs for FMS compatibility):
    08-12-18 22:50:59       Error:  -9      Invalid FLV message footer.     200812171225_327.flv
    or
    08-12-18 22:51:12       Error:  -11     Found backward timestamp.       200812171228_328.flv
You can fix these errors using ffmpeg.

libavcodec.so: undefined reference to `speex_header_free'

I tried to compile the current SVN trunk (16005) of FFmpeg on a Debian Etch system with libspeex support. However I got the error message as in the title of this post:
/home/test/ffmpeg/libavcodec/libavcodec.so: undefined reference to `speex_header_free'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

I used the libspeex-dev package that is part of Debian Etch (it was v1.1.12-3etch1).
Please, drop here a comment if you find out how to resolve this. Maybe I should download and compile libspeex from source? The one in Debian might be outdated.

Syndicate content