Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques .mov (h264) to .flv using ffmpeg

  • .mov (h264) to .flv using ffmpeg

    Posted by Jay Carr on August 2, 2011 at 6:09 pm

    I should first clarify, I’m using iffmpeg which is a skin for ffmpeg, but it works the same…

    Anyway, to the problem. I have a video that’s a .mov with an .h264 codec. At about 4400kbs, 1280x720p, 59.97fps and 3:20 in length, it ends up being around 115mb. When I upload said video to Youtube they magically compress it down to 28mb, without much of a loss of quality.

    So, I set 28mbs as my target because I’m trying to deliver the video as an .flv for our companies website. The intention being to stream the video from our own flash player. I figure, if YouTube can do it, I can figure it out.

    Here’s the problem: I can’t get the .mov over to a .flv without a huge loss in quality. Every time I lower the kbs below 2048 I end up with this weird problem where ever other half second the screen becomes blotchy. Plus, I can’t get it to be nearly as small as the videos I see on YouTube.

    What bugs me is this: If I decide to convert it from a .mov to a (smaller) .mov I can actually reach my target. I have converted the video from the settings above to a video that has: 1024kbs, 23.97fps, but everything else is the same. It still looks good, and it’s only 27mb.

    What bugs me even more is knowing that .flv can contain a .h264. So, why can’t I use the same settings on my .flv and have it look the same? Heck, when I use the same settings, the file ends up being twice as big and looking much worse!

    Any thoughts? Is it .flv that’s the problem? Is it iffmpeg? I wonder if ffmpeg uses .h264 inside of it’s .flvs? If not, is there some simple way to take my lovely .h264 from the .mov that it’s in and just drop it into a .flv? I’m kinda lost at this point…

    Jay Carr replied 14 years, 9 months ago 2 Members · 6 Replies
  • 6 Replies
  • Craig Seeman

    August 2, 2011 at 7:36 pm

    [Jay Carr] “Here’s the problem: I can’t get the .mov over to a .flv without a huge loss in quality.”

    Generally you shouldn’t put H.264 in flv. It should be .f4v or .mp4 but .mov will work as well

    Data rate is just one factor in maintaining quality. There’s entropy (CAVLC vs CABAC) and B frames (which can increase efficiency as well). Also doing multiple pass VBR can help.

    There’s also the variation of H.264 being used. x264 is very good though especially when compared to Apple’s H.264 for example.

    To really see what YouTube is doing you should examine their files in MediaInfo but even that may not tell you the full picture. Also examine your encode to make sure it’s not using VP6 or Sorenson Spark (or H.263) for example.

  • Jay Carr

    August 2, 2011 at 7:43 pm

    I think I’m confused…

    I suppose I should start by asking what program you are using? FFmpeg doesn’t seem to have an option for .f4v (though I haven’t tried doing an .mp4 yet, and then putting that into the flv. I’ll try that.)

    Also, I didn’t know there were multiple version of h.264. I guess I need to look up what x264 is, I think I can probably just wiki it.

    Yeah, that, and I’ll take a look at MediaInfo to figure that part out as well. I’m assuming that will allow me to see what’s in the container?

  • Craig Seeman

    August 2, 2011 at 8:03 pm

    [Jay Carr] “Also, I didn’t know there were multiple version of h.264. I guess I need to look up what x264 is, I think I can probably just wiki it.”

    There are many versions of H.264 and they are certainly not equal. Apple’s seems to be the least flexible and not good at lower bit rates.

    x264 is good. MainConcept is good and used both by Telestream Episode and Sorenson Squeeze. I think also by Adobe Media Encoder. Dicas is another one (Episode used to use it). There are others such as Matrox MAX which is also good. There are a few others out there.

    [Jay Carr] “I suppose I should start by asking what program you are using? FFmpeg doesn’t seem to have an option for .f4v “

    I generally use Telestream Episode. I prefer to use .mp4 over .f4v for Flash though. I’ve stopped using VP6 .flv a while back.

  • Jay Carr

    August 2, 2011 at 8:06 pm

    Well, it looks like FFmpeg is using Sorenson Spark to create my .flvs. Is there a way to make it use x264 or even h264? That might solve a lot of the problem right there…

  • Craig Seeman

    August 2, 2011 at 8:53 pm

    [Jay Carr] “Well, it looks like FFmpeg is using Sorenson Spark to create my .flvs.”

    ARGH! Ugly little ancient codec. Squash it quickly. Remember when YouTube videos used to look like really bad quality some years back? They were using a “relative” of Spark I believe. Banish it to the dustbin of compression history and don’t breath in too deeply because the dust will give you a sneezing fit.

    Generally Flash Player is compatible with H.264 and is extension agnostic. x264 is a free Quicktime component. Once installed you can access it from Compressor, Telestream Episode, MPEGStreamclip, Quicktime 7 Pro.

    I’m not sure what flavor H.264 iffmpeg is using (it might even be x264) but try creating an H.264 .mp4 which would work fine in Flash.

    https://www.videolan.org/developers/x264.html
    and it says

    Software using x264
    Avidemux
    ELDER
    ffdshow
    ffmpeg
    GordianKnot
    Handbrake
    LiVES
    MeGUI
    MEncoder
    pspVideo9
    Bencos (formerly RealAnime)
    StaxRip
    VLC media player
    TMPGEnc Video Mastering Works 5

    See this for some background info on x264
    https://en.wikipedia.org/wiki/X264

  • Jay Carr

    August 2, 2011 at 9:12 pm

    Ah, hah! After your last little comment there (showing that libx264 is what I needed to use), I was able to do a little bit of searching and figured out how to fit the libx264 into a .flv. Success! It looks great! Thank you ever so much for your help!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy