Who knows about ffmpeg - flash video stuff - help me out please...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • VIPimp
    Marina WILL have my babies!
    • May 2003
    • 9234

    #1

    Who knows about ffmpeg - flash video stuff - help me out please...

    I am clueless about this stuff... here is what I am trying to do...
    I have wmvs/mpgs that I am trying to convert to flash files using ffmpeg, I need to know what is the best recommended settings to set the following to:
    -s 480x360 -b 500 -acodec mp3 -ar 22050 -qscale 11
    So that the video is good clear quality but the file size is a decent size as well. AND I will be playing them in a flash player with the size of : 600x470

    Can someone who has done this before and familiar with it, help me out... I'll owe you a favor, thanks.
  • VIPimp
    Marina WILL have my babies!
    • May 2003
    • 9234

    #2
    hello???

    Comment

    • Tempest
      Too lazy to set a custom title
      • May 2004
      • 10217

      #3
      Having the video at 480x360 and then having the video player scale it up to 600x470 is going to look like crap at a bit rate of 500.. I'd try 2 things.. I'd try having the video at 600x470 or try 300x235.. scaling by multiples of 2 usually yields better results.. then adjust the bitrate... not sure where you got the 500 from, but when I run ffmpeg it didn't encode at 500kbps as expected... I ended up with 768000 to get 768kbps... You may find that 300x235 1024000 actually has a smaller file size and yet looks better than 600x470 512000...

      Comment

      • VIPimp
        Marina WILL have my babies!
        • May 2003
        • 9234

        #4
        Originally posted by Tempest
        Having the video at 480x360 and then having the video player scale it up to 600x470 is going to look like crap at a bit rate of 500.. I'd try 2 things.. I'd try having the video at 600x470 or try 300x235.. scaling by multiples of 2 usually yields better results.. then adjust the bitrate... not sure where you got the 500 from, but when I run ffmpeg it didn't encode at 500kbps as expected... I ended up with 768000 to get 768kbps... You may find that 300x235 1024000 actually has a smaller file size and yet looks better than 600x470 512000...
        Thank you for your reply... I will try that out now.

        Do you or anyone know if when I have the -qscale, does that overwrite the -b... not sure if both are needed or just one of those.

        Thanks again.
        Last edited by VIPimp; 03-15-2008, 11:26 PM.

        Comment

        • VIPimp
          Marina WILL have my babies!
          • May 2003
          • 9234

          #5
          Wierd when I try to convert with this size 300x235... I get a error.

          Comment

          • fuzebox
            making it rain
            • Oct 2003
            • 22363

            #6
            For starters I'd drop the qscale argument... Also the -s ###x### should be the size you want the video to be displayed at. Finally, -b requires a value in bps, not kbps, so if you are looking for 500 kbps it should be printed as -b 500000.

            Comment

            • VIPimp
              Marina WILL have my babies!
              • May 2003
              • 9234

              #7
              Originally posted by fuzebox
              For starters I'd drop the qscale argument... Also the -s ###x### should be the size you want the video to be displayed at. Finally, -b requires a value in bps, not kbps, so if you are looking for 500 kbps it should be printed as -b 500000.
              For some reason the file size stayed the same when I changed -b 500 to -b 768000... could that be because I had the -qscale in there or is my script screwed up?

              And do you know why it wont convert when I have the -s set to 300x235 ? is there a min required size or ?

              Thanks you.

              Comment

              • VIPimp
                Marina WILL have my babies!
                • May 2003
                • 9234

                #8
                Another question to add to the list...

                when I convert a file with the ffmpeg crap and I open the flv file in videocharge, it says the bit rate is 0... but when I convert that same original video to flv using other converters and not ffmpeg they all display a bit rate.... any idea why that is?

                thanks

                Comment

                • Chio
                  Confirmed User
                  • Oct 2002
                  • 8002

                  #9
                  Originally posted by VIPimp
                  Another question to add to the list...

                  when I convert a file with the ffmpeg crap and I open the flv file in videocharge, it says the bit rate is 0... but when I convert that same original video to flv using other converters and not ffmpeg they all display a bit rate.... any idea why that is?

                  thanks
                  It's likely that ffmpeg is not writing the metadata to the file.

                  PS Relink's tube script is coming very soon.

                  I seo'd my hair yesterday and today it's pr7!
                  RIP Texas Dreams

                  Are you a content producer or program owner sick of tube sites? Contact me on ICQ: 39-183769

                  Comment

                  • VIPimp
                    Marina WILL have my babies!
                    • May 2003
                    • 9234

                    #10
                    Originally posted by Chio
                    It's likely that ffmpeg is not writing the metadata to the file.
                    Is that something I should be worried about or is that not important and not affect the quality/play of the video?

                    Thanks Chio.

                    Comment

                    • Tempest
                      Too lazy to set a custom title
                      • May 2004
                      • 10217

                      #11
                      Originally posted by VIPimp
                      Another question to add to the list...

                      when I convert a file with the ffmpeg crap and I open the flv file in videocharge, it says the bit rate is 0... but when I convert that same original video to flv using other converters and not ffmpeg they all display a bit rate.... any idea why that is?

                      thanks
                      Forgot to mention that converting to flv requires multiples of 2.. so it won't like 300x235... you'll need to do it as 300x234 or 300x236.. sorry about that.. I ran into the same thing once and I forgot about that.

                      Once you convert using ffmpeg, you then need to also use a tool like flvtools2 or flvmdi to fix up the flv with metadata and then your problem will go away...

                      Even when you convert files to flv using videocharge etc., you should still run flvmdi on the files.. On your server you would use flvtools2.. not sure if there are alternatives.

                      Comment

                      • Iron Fist
                        Too lazy to set a custom title
                        • Dec 2006
                        • 23400

                        #12
                        This thread gives me a headache
                        i like waffles

                        Comment

                        • Phoenix
                          BACON BACON BACON
                          • Nov 2002
                          • 35475

                          #13
                          one of the best threads on here in awhile

                          i am no programmer..but i like ffmpeg..it is inside uugallery which helps me make fesh blog posts
                          Telegram PhoenixBrad
                          https://quantads.io

                          Comment

                          • VIPimp
                            Marina WILL have my babies!
                            • May 2003
                            • 9234

                            #14
                            Originally posted by Tempest
                            Forgot to mention that converting to flv requires multiples of 2.. so it won't like 300x235... you'll need to do it as 300x234 or 300x236.. sorry about that.. I ran into the same thing once and I forgot about that.

                            Once you convert using ffmpeg, you then need to also use a tool like flvtools2 or flvmdi to fix up the flv with metadata and then your problem will go away...

                            Even when you convert files to flv using videocharge etc., you should still run flvmdi on the files.. On your server you would use flvtools2.. not sure if there are alternatives.
                            THANK YOU... just a quick question, if I dont run the flvtools or anything after ffmpeg, is there any downside to that as far as the quality and people being able to view it.

                            Comment

                            • VIPimp
                              Marina WILL have my babies!
                              • May 2003
                              • 9234

                              #15
                              All the different variations of bitrate and size I tried with 1 video, doesnt change it much... its only when I use the -qscale with a value of around 3 is when the video quality is good and somewhere near the original WMV file.

                              Comment

                              • Tempest
                                Too lazy to set a custom title
                                • May 2004
                                • 10217

                                #16
                                Originally posted by VIPimp
                                THANK YOU... just a quick question, if I dont run the flvtools or anything after ffmpeg, is there any downside to that as far as the quality and people being able to view it.
                                Not sure... I had some sync issues, video length reporting etc. in the past that went away once I ran the videos thru flvmdi... yeah it's a bit of a pain getting that stuff all working but if you script the conversions then it can be done all automatically for you.

                                re: -qscale, truth is I haven't played with all the settings a lot as I just get something decent looking and I'm happy enough since I want the surfers to sign up to a site to get the better quality videos... But after doing some reading I'm going to have to try out -qscale... it appears that if you don't use it, then the video is encoded CBR (constant bit rate) but the quality can vary frame to frame.. but by using -qscale it encodes it VBR (variable bit rate) so the quality stays constant but the bit rate changes.. Could lead to some smaller video size but I suspect you would need to cap the bitrate or set the min max... with -qscale, the values can be 1 to 31 with 1 being the best so with 3 you're almost as good as can be... what are the file sizes like?

                                I've seen some people post using other paramers like these ones:

                                -nr 500
                                -deinterlace
                                -me_range 25
                                -i_qfactor 0.71
                                -g 500

                                Not sure what -g is used for

                                someone else on here posted awhile back this stuff

                                -pass 1 -g 240 -qcomp 0.6 -qmax 15 -qdiff 4 -i_qfactor 0.71428572 -b_qfactor 0.76923078 -maxrate 950 -bufsize 485 -s 512x384 -b 800 -refs 1 -subq 1 -r 25 -acodec mp3 -ab 48 -ar 22050 -ac 1 -y

                                here's some other parameters I found...

                                -f flv -deinterlace -nr 500 -s 640x420 -r 30 -b 270k -me_range 25 -i_qfactor 0.9 -qmin 8 -qmax 8 -g 500 out.flv

                                So many things to play with... Need a degree in video compression to understand it all...

                                Comment

                                • VIPimp
                                  Marina WILL have my babies!
                                  • May 2003
                                  • 9234

                                  #17
                                  Originally posted by Tempest
                                  Not sure... I had some sync issues, video length reporting etc. in the past that went away once I ran the videos thru flvmdi... yeah it's a bit of a pain getting that stuff all working but if you script the conversions then it can be done all automatically for you.

                                  re: -qscale, truth is I haven't played with all the settings a lot as I just get something decent looking and I'm happy enough since I want the surfers to sign up to a site to get the better quality videos... But after doing some reading I'm going to have to try out -qscale... it appears that if you don't use it, then the video is encoded CBR (constant bit rate) but the quality can vary frame to frame.. but by using -qscale it encodes it VBR (variable bit rate) so the quality stays constant but the bit rate changes.. Could lead to some smaller video size but I suspect you would need to cap the bitrate or set the min max... with -qscale, the values can be 1 to 31 with 1 being the best so with 3 you're almost as good as can be... what are the file sizes like?

                                  I've seen some people post using other paramers like these ones:

                                  -nr 500
                                  -deinterlace
                                  -me_range 25
                                  -i_qfactor 0.71
                                  -g 500

                                  Not sure what -g is used for

                                  someone else on here posted awhile back this stuff

                                  -pass 1 -g 240 -qcomp 0.6 -qmax 15 -qdiff 4 -i_qfactor 0.71428572 -b_qfactor 0.76923078 -maxrate 950 -bufsize 485 -s 512x384 -b 800 -refs 1 -subq 1 -r 25 -acodec mp3 -ab 48 -ar 22050 -ac 1 -y

                                  here's some other parameters I found...

                                  -f flv -deinterlace -nr 500 -s 640x420 -r 30 -b 270k -me_range 25 -i_qfactor 0.9 -qmin 8 -qmax 8 -g 500 out.flv

                                  So many things to play with... Need a degree in video compression to understand it all...
                                  Thanks, a lot of info there... I am not going to even think about all those other parameters lol...

                                  To answer your question... The file I been playing with is a 7mb 1min wmv clip... when I did -qscale 3 it gave me a great video but the size turned out to be around 18mb... -qscale 5 made it around 10mb... without -qscale all the different tests I did, the output file ranged from 4-7mb all of which the quality sucked.

                                  This whole thing is a pain in the ass, so many different options ect.

                                  Thanks again for your help, before reading this I was wondering what CBR and ABR stood for as I came across them now while playing with another software, you answered that for me.

                                  Comment

                                  • VIPimp
                                    Marina WILL have my babies!
                                    • May 2003
                                    • 9234

                                    #18
                                    Originally posted by sharphead
                                    This thread gives me a headache
                                    Imagine how I feel.

                                    Comment

                                    • Tempest
                                      Too lazy to set a custom title
                                      • May 2004
                                      • 10217

                                      #19
                                      Originally posted by VIPimp
                                      To answer your question... The file I been playing with is a 7mb 1min wmv clip... when I did -qscale 3 it gave me a great video but the size turned out to be around 18mb... -qscale 5 made it around 10mb... without -qscale all the different tests I did, the output file ranged from 4-7mb all of which the quality sucked.
                                      Try dropping the frame rate.... Use -r 15 for a frame rate of 15fps and my tests still look good, not even noticeable... Use to do that in the old days and forgot all about it.

                                      Comment

                                      • VIPimp
                                        Marina WILL have my babies!
                                        • May 2003
                                        • 9234

                                        #20
                                        Originally posted by Tempest
                                        Try dropping the frame rate.... Use -r 15 for a frame rate of 15fps and my tests still look good, not even noticeable... Use to do that in the old days and forgot all about it.
                                        Will try that out...

                                        I am playing with this converter now: Sorenson Squeeze with VP6... my first test with it I got a super quality video with the same file size as what the ffmpeg spit out with its worst quality video. So I'm thinking of just using this to batch convert my wmvs to flv, though it does take longer but seems worth it.

                                        I am just confused again with this on what to put in the fields, maybe you can help me out with that, here is my question from another thread:

                                        Originally posted by VIPimp
                                        Can one of you guys answer this for me, I am now using SORENSON VP6...

                                        I want the vids to playback the best on my site for the surfer, so is it better for me to use....
                                        1. 2-PASS CBR or 2-PASS ABR
                                        2. Key Frame every 300 or 45 frames. and frame rate set to 1:1 for either right?

                                        and for extra credit... 3. its best I maintain Aspect Ratio or have it unconstrained?

                                        Data rate I'm prolly having it at 768 Kbps

                                        Thank you in advance. once i know about the above 3 then I think I am good to go.

                                        Comment

                                        • Tempest
                                          Too lazy to set a custom title
                                          • May 2004
                                          • 10217

                                          #21
                                          Don't know about #1 but 2 pass anything should yield better compression than 1 pass..

                                          2. Every 45 frames will be better than every 300.. A key frame is basically an uncompressed frame.. every "frame" after that is compressed as the difference between that keyframe and the current frame. So the more keyframes the better the quality of the video but also the larger the file. I'd assume that 1:1 means that the frame rate of the output is the same as the input file. Again, reducing the frame rate will reduce the file size while still looking good.. Most people can't tell the difference between 30fps and 60fps or even 15fps.

                                          You maintain the aspect ratio...

                                          Yeah, the VP6 compressor is better quality than the older one in ffmpeg... Surfers need to be using a more recent version of Flash in order to watch them though but I'm sure most have upgraded to at least v8.. Not sure if there's licensing issues though with VP6...

                                          Comment

                                          • Nathan
                                            Confirmed User
                                            • Jul 2003
                                            • 3108

                                            #22
                                            if you want to still use ffmpeg, here are a few tips:

                                            1) always use the latest SVN version of ffmpeg, do not get a standard release, the app changes 5 times a day.
                                            2) use 2 passes to encode, not just 1
                                            3) never use -qscale, its not going to work right, I tried it for weeks.
                                            4) for high res great quality video, I tend to use these settings:
                                            pass 1: -f flv -vcodec flv -keyint_min 250 -r 25 -ar 44100 -ab 96 -b 3000k -s 1024x820 -g 150 -pass 1 -y
                                            pass 2: -f flv -vcodec flv -mbd 2 -flags +mv0+trell+cbp -keyint_min 250 -r 25 -ar 44100 -ab 96 -b 3000k -s 1024x820 -g 150 -pass 2

                                            The -s of course depends on your original video, thats just a sample size, keep the ratio obviously.

                                            For the player size you suggested, I would use a size of around 540x432 and at that size, these other settings:
                                            -ar 22050 -ab 32 -b 700k

                                            At that quality, stretching the video to the player size you mentioned is going to be totally fine.

                                            keyframes every 250 frames is also completely enough, with -r 25 that means one keyframe every 10 seconds. This is whats going to keep the size of your file down the most. ffmpeg will also lower the bitrate automatically if it achives a qscale of 2.0 with a lower one. Thats what 2 passes is good for.

                                            The keyframe rate does mean of course that framegrabs are only possible every 10 seconds from the flv. So if that is not enough framegrabs for you, build frames for the original wmv instead.

                                            It also means that in a skipable player, they can skip 10 seconds at a time, which usually is fine though in my oppinion.

                                            Your question if running the flv through for example flvtool2 after converting is needed... answer is no, its not NEEDED, but you would be stupid not to. Not using it will ruin the player experience for the user that he got so accustomed to. I at least would never do that.
                                            "Think about it a little more and you'll agree with me, because you're smart and I'm right."
                                            - Charlie Munger

                                            Comment

                                            • ideaworx
                                              GOW Technician
                                              • Jul 2005
                                              • 1132

                                              #23
                                              any options outside using serverside?... can a guy encode this on win/mac desktop?... i have seen Flix Pro and the Sorenson Squeeze... i have my player ready, and lighttpd installed, but am running into issues on running the scripts w/ my host, thanks
                                              Amateur Australian Porn At It's Finest: Girls Out West --> Girls Out West Affiliate Program

                                              Comment

                                              • ideaworx
                                                GOW Technician
                                                • Jul 2005
                                                • 1132

                                                #24
                                                Edit: Trying Avanti, seems promising, will keep you updated
                                                Amateur Australian Porn At It's Finest: Girls Out West --> Girls Out West Affiliate Program

                                                Comment

                                                • VIPimp
                                                  Marina WILL have my babies!
                                                  • May 2003
                                                  • 9234

                                                  #25
                                                  Originally posted by Nathan
                                                  if you want to still use ffmpeg, here are a few tips:

                                                  1) always use the latest SVN version of ffmpeg, do not get a standard release, the app changes 5 times a day.
                                                  2) use 2 passes to encode, not just 1
                                                  3) never use -qscale, its not going to work right, I tried it for weeks.
                                                  4) for high res great quality video, I tend to use these settings:
                                                  pass 1: -f flv -vcodec flv -keyint_min 250 -r 25 -ar 44100 -ab 96 -b 3000k -s 1024x820 -g 150 -pass 1 -y
                                                  pass 2: -f flv -vcodec flv -mbd 2 -flags +mv0+trell+cbp -keyint_min 250 -r 25 -ar 44100 -ab 96 -b 3000k -s 1024x820 -g 150 -pass 2

                                                  The -s of course depends on your original video, thats just a sample size, keep the ratio obviously.

                                                  For the player size you suggested, I would use a size of around 540x432 and at that size, these other settings:
                                                  -ar 22050 -ab 32 -b 700k

                                                  At that quality, stretching the video to the player size you mentioned is going to be totally fine.

                                                  keyframes every 250 frames is also completely enough, with -r 25 that means one keyframe every 10 seconds. This is whats going to keep the size of your file down the most. ffmpeg will also lower the bitrate automatically if it achives a qscale of 2.0 with a lower one. Thats what 2 passes is good for.

                                                  The keyframe rate does mean of course that framegrabs are only possible every 10 seconds from the flv. So if that is not enough framegrabs for you, build frames for the original wmv instead.

                                                  It also means that in a skipable player, they can skip 10 seconds at a time, which usually is fine though in my oppinion.

                                                  Your question if running the flv through for example flvtool2 after converting is needed... answer is no, its not NEEDED, but you would be stupid not to. Not using it will ruin the player experience for the user that he got so accustomed to. I at least would never do that.


                                                  Thank you Nathan for all the info.


                                                  I think for now I'm going to go with Sorenson's VP6 converter... I'll play with ffmpeg some more later.

                                                  Comment

                                                  • Tempest
                                                    Too lazy to set a custom title
                                                    • May 2004
                                                    • 10217

                                                    #26
                                                    Nice info there Nathan... Been doing more reading etc. and I saw something that seemed to indicate mencoder will do VP6 but will need to check into that more... Also, it seems like H.264 might be as good or better than VP6, I think it's supported in the latest Flash players and it's open source to some level.. doesn't appear that you can encode with it yet in ffmpeg though.

                                                    Comment

                                                    • O MARINA
                                                      I'm clockin' ya, Versace shade watchin' ya
                                                      • Mar 2003
                                                      • 13794

                                                      #27
                                                      Originally posted by VIPimp
                                                      hello???
                                                      hello

                                                      is it me you're looking for























                                                      thank god someone replied to you allah akbar

                                                      Comment

                                                      • Tempest
                                                        Too lazy to set a custom title
                                                        • May 2004
                                                        • 10217

                                                        #28
                                                        Check this out.. This guy really knows his encoding... Using H.264 and the new audio compressor AAC, he encoded it at 320x200, the video is ONLY 100Kbit/s and the audio is only 24 Kbit/s..
                                                        http://www.flashvideofactory.com/blog.htm#230208

                                                        Been trying to use H.264 (you can get the library x264 compiled into ffmpeg) but it's crashing on WinCrap right now...

                                                        Comment

                                                        Working...