12 Replies Latest reply on Aug 2, 2011 3:27 PM by Nikhil Pavan Kalyan

    ffmpeg to generate mp4


      Hi all,


      I'm currently unable to generate the chuncks using f4fpackager on mp4 files created with ffmpeg.


      Here is the ffmpeg command :

      ffmpeg -i video.flv -vcodec libx264  -vpre superfast -b 1500k -acodec libfaac -ab 128k -async 1 -f mp4 video.mp4


      and the f4fpackager command :

      f4fpackager --input-file=video.mp4 --segment-duration=10 --output-path=/var/www/vod


      The result : only the first 2 segments and the f4m files are generated.

      Btw, flvcheck video4.mp4 said passed.


      Has anyone already been able to run f4fpackager on ffmpeg generated mp4 files ?





        • 1. Re: ffmpeg to generate mp4
          Nikhil Pavan Kalyan Level 4



          Thanks for using the file packager.

          There are known issue(s) with file packager and files encoded using ffmpeg. We are almost on the verge of fixing the problem and have the new bits ready. Meanwhile, can you also please forward the file that you tried to fragment, so that we could test the fix on this file(s) as well.


          Thank you !

          • 2. Re: ffmpeg to generate mp4
            Xris01 Level 1



            Thanks for your reply.

            You can download a sample test file here : http://www.mediafire.com/?50sxmc2fu58a4a4




            • 3. Re: ffmpeg to generate mp4
              Nikhil Pavan Kalyan Level 4




              Thanks for the file, i downloaded it and tried to fragment using the file packager. When i do not set the segment duration (leaving it to default), the fragment is created well and the playback is smooth till the end of the file.


              f4fpackager.exe --input-file=batman.mp4




              when the segment duration is mentioned (to 10 sec), some of the index information was incorrectly/not written and hence the playback fails after the first fragment (which is what you are hitting).


              f4fpackager.exe --input-file=batman.mp4 --segment-duraiton=10


              So, as a work around, is it ok for you to use a single segment ? I would raise this issue to get it fixed and will let you of the proceedings.
              Thank you ! 

              • 4. Re: ffmpeg to generate mp4
                Xris01 Level 1



                Thanks for your reply.

                This may be an acceptable workaround for short videos, but not for long videos, as there may be a waste of bandwidth if the user quit before the end (same as progressive download).




                • 5. Re: ffmpeg to generate mp4
                  Nikhil Pavan Kalyan Level 4

                  The workaround i mentioned is only for this file. There should not be any problem in using any segment duration for your longer video files. There must be some file specific issue with this , that's causing the packager to not fragment.

                  You can try with other longer files to package with segment duration and let us know if there are any issues.

                  Thank you !

                  • 6. Re: ffmpeg to generate mp4

                    I also have problem with fragmenting files created by ffmpeg (.mp4/h264/aac). In my case only audio is written to .f4f file with no video track. Running f4fpackager with --sample-dump shows only first video frame at timestamp 0. Following are only audio samples with all other video frames missing.

                    How soon can we expect release of f4fpackager compatible with ffmpeg?  Are there any workarounds I could use?


                    Would link to my test file be useful for you?

                    • 7. Re: ffmpeg to generate mp4
                      Nikhil Pavan Kalyan Level 4

                      Sure, please send us the test files, that would be of great help to us.

                      • 8. Re: ffmpeg to generate mp4
                        qbast Level 1

                        Actually I found a workaround. After creating mp4 file with ffmpeg, I process it using MP4Box -hint <file> before running f4fpackager. It worked ok on every file I tested.

                        • 9. Re: ffmpeg to generate mp4

                          Hello Nikhil,


                          We have the same kind of issues with will generated with ffmpeg and f4fpackager:


                          - if we disable bframes (-bf 0) it works ok

                          - if we use bframes no segment are generated (only an empty segment 0)

                          - if we use bframes and remux the video file using mp4box or mp4creator, all segments a generated but the first segment is skipped by the player, and apache2/mod_f4f returns an HTTP error 503 with no more infos in the log


                          We use f4fpackager for Flash Access 2 and we have a huge video catalog to package automatically so  we can't check every packaged files.

                          So it would be nice if f4fpackager could raise an error when it can't create the segments, because today it fails silently so we can't know automatically if it worked or not.


                          On a side note, we use f4fpackager on linux 32bits (and 64 bits).

                          It is version 1.0, is there an updated version or could we have access to a beta/dev version so we could help you testing this on our video catalog?

                          • 10. Re: ffmpeg to generate mp4
                            Nikhil Pavan Kalyan Level 4



                            Thanks for the details. I am not sure of the packaging failing with b-frame specific content, i can only go back and test, and can let you know of the findings. I would take this on priority and would update you.


                            There are no updated version of the packager as such, and there is no beta release program going on as of now that you can subscribe to

                            The packager, as you mentioned, fails silently and this was a known issue, asked many times for enhancement.

                            • 11. Re: ffmpeg to generate mp4
                              _sebest_ Level 1

                              Thanx Nikhil,


                              I have made a zipfile with 3 version of the same video:

                              - no bframes no remux: works

                              - bframes + no remux: no segment

                              - bframes + remux: segment but the first segment doesn t work




                              Any idea of a timeframe for a fixed version?

                              • 12. Re: ffmpeg to generate mp4
                                Nikhil Pavan Kalyan Level 4

                                Thanks for sharing the files. Tomorrow I would take a quick look at all of these.

                                Sorry but AFAIK, there is no timeframe that I can provide you for the next release.