Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Merge Mpg

Merge Mpg

Scheduled Pinned Locked Moved Graphics
questioncom
15 Posts 2 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mjmim
    wrote on last edited by
    #1

    I have a list of mpgs that i want to merge. How can i merge two mpg's in my program. I am not interested in using an outside tool. Is this possible with Graphedit? Is there any open source code that does this. If i do a binary copy like with : copy /b (names of files) (output file) than the length of the movie is incorrect (i basically corrupt the header i guess). Any suggestions? Thank You, Michael mjmimmm@hotmail.com mjmimmm@hotmail.com

    M 1 Reply Last reply
    0
    • M mjmim

      I have a list of mpgs that i want to merge. How can i merge two mpg's in my program. I am not interested in using an outside tool. Is this possible with Graphedit? Is there any open source code that does this. If i do a binary copy like with : copy /b (names of files) (output file) than the length of the movie is incorrect (i basically corrupt the header i guess). Any suggestions? Thank You, Michael mjmimmm@hotmail.com mjmimmm@hotmail.com

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Graphedit could maybe do it but it can't ouput an mpeg file unless you have a 3rd-party MPEG encoder filter. Here's some online resources that may help. The MPEG Home Page[^] mpeg.org[^] Mark

      "If you can dodge a wrench, you can dodge a ball."

      M 1 Reply Last reply
      0
      • M Mark Salsbery

        Graphedit could maybe do it but it can't ouput an mpeg file unless you have a 3rd-party MPEG encoder filter. Here's some online resources that may help. The MPEG Home Page[^] mpeg.org[^] Mark

        "If you can dodge a wrench, you can dodge a ball."

        M Offline
        M Offline
        mjmim
        wrote on last edited by
        #3

        I have a an mpeg2 encoder. How can i merge the current mpgs in directshow with graphedit for instance? thnx, Michael mjmimmm@hotmail.com

        M 1 Reply Last reply
        0
        • M mjmim

          I have a an mpeg2 encoder. How can i merge the current mpgs in directshow with graphedit for instance? thnx, Michael mjmimmm@hotmail.com

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Are you just looking for a tool to do it or are you writing a tool to do it? Graphedit isn't a viseo editor - it's just for testing filter graphs. Mark

          "If you can dodge a wrench, you can dodge a ball."

          M 1 Reply Last reply
          0
          • M Mark Salsbery

            Are you just looking for a tool to do it or are you writing a tool to do it? Graphedit isn't a viseo editor - it's just for testing filter graphs. Mark

            "If you can dodge a wrench, you can dodge a ball."

            M Offline
            M Offline
            mjmim
            wrote on last edited by
            #5

            I have 4-5 mpgs with video and sound. I am writing a program that among other things needs to merge the mpgs into one long mpg and then add background music from a seperate .wav file. I was thinking of doing this with directshow. I know that graphedit is only a tool :). But a lot of times it is possible to use it to test different filters to see how it works out. Basically i need to do two things: 1. Merge the mpgs (which have video and sound). 2. Add background music (this is turning out to be the more complicated demand). Any advice, guidelines, open source code that does these things? (windows environment) thank you, Michael mjmimmm@hotmail.com

            M 1 Reply Last reply
            0
            • M mjmim

              I have 4-5 mpgs with video and sound. I am writing a program that among other things needs to merge the mpgs into one long mpg and then add background music from a seperate .wav file. I was thinking of doing this with directshow. I know that graphedit is only a tool :). But a lot of times it is possible to use it to test different filters to see how it works out. Basically i need to do two things: 1. Merge the mpgs (which have video and sound). 2. Add background music (this is turning out to be the more complicated demand). Any advice, guidelines, open source code that does these things? (windows environment) thank you, Michael mjmimmm@hotmail.com

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              How about DirectShow Editing Services[^]?

              "If you can dodge a wrench, you can dodge a ball."

              M 1 Reply Last reply
              0
              • M Mark Salsbery

                How about DirectShow Editing Services[^]?

                "If you can dodge a wrench, you can dodge a ball."

                M Offline
                M Offline
                mjmim
                wrote on last edited by
                #7

                First of all, I would like to say thank you for the reference, I had not even heard of this before. It seems from a short glimpse that this would definitly work for my first problem. But I haven't been able to see how i could use this to solve my second problem (inserting\joining\merging\adding a wav to an mpeg file). Thank You Very Much, Michael Mjmimmm@hotmail.com

                M 1 Reply Last reply
                0
                • M mjmim

                  First of all, I would like to say thank you for the reference, I had not even heard of this before. It seems from a short glimpse that this would definitly work for my first problem. But I haven't been able to see how i could use this to solve my second problem (inserting\joining\merging\adding a wav to an mpeg file). Thank You Very Much, Michael Mjmimmm@hotmail.com

                  M Offline
                  M Offline
                  Mark Salsbery
                  wrote on last edited by
                  #8

                  Check out the "Introduction to..." link (first link on that page). It seemed pretty close to what you're wanting to do: "For example, suppose you wanted to create a video sequence consisting of 4 seconds from source A, followed by 10 seconds from source B, and ending with 5 seconds from source C. You could accomplish that much fairly easily using only the core DirectShow API. But what if you decided that source C should come before source B, not after; that the sequence should use 8 seconds from source A, not 4; and that the entire production needed a separate audio track playing in the background? Even minor changes such as these could be difficult to implement. But the scenario just described is a trivial editing project in DES—you can do it with a handful of method calls." You could do it by directly manipulating the filter graph and handling all the timestamp issues but it could be a TASK! :) Mark

                  "If you can dodge a wrench, you can dodge a ball."

                  M 1 Reply Last reply
                  0
                  • M Mark Salsbery

                    Check out the "Introduction to..." link (first link on that page). It seemed pretty close to what you're wanting to do: "For example, suppose you wanted to create a video sequence consisting of 4 seconds from source A, followed by 10 seconds from source B, and ending with 5 seconds from source C. You could accomplish that much fairly easily using only the core DirectShow API. But what if you decided that source C should come before source B, not after; that the sequence should use 8 seconds from source A, not 4; and that the entire production needed a separate audio track playing in the background? Even minor changes such as these could be difficult to implement. But the scenario just described is a trivial editing project in DES—you can do it with a handful of method calls." You could do it by directly manipulating the filter graph and handling all the timestamp issues but it could be a TASK! :) Mark

                    "If you can dodge a wrench, you can dodge a ball."

                    M Offline
                    M Offline
                    mjmim
                    wrote on last edited by
                    #9

                    Hey mark, I'll check it out.. hopefully i won't ever bug u again. Thank's alot, now there are no excuses left and i have to get to work... Good weekend :). Michael

                    M 1 Reply Last reply
                    0
                    • M mjmim

                      Hey mark, I'll check it out.. hopefully i won't ever bug u again. Thank's alot, now there are no excuses left and i have to get to work... Good weekend :). Michael

                      M Offline
                      M Offline
                      Mark Salsbery
                      wrote on last edited by
                      #10

                      mjmim wrote:

                      hopefully i won't ever bug u again

                      :laugh: If it bothered me I wouldn't be here responding. If you run into problems then definitely post questions here - that's what the site's for. Good weekend to you as well, thanks! Mark

                      "If you can dodge a wrench, you can dodge a ball."

                      M 1 Reply Last reply
                      0
                      • M Mark Salsbery

                        mjmim wrote:

                        hopefully i won't ever bug u again

                        :laugh: If it bothered me I wouldn't be here responding. If you run into problems then definitely post questions here - that's what the site's for. Good weekend to you as well, thanks! Mark

                        "If you can dodge a wrench, you can dodge a ball."

                        M Offline
                        M Offline
                        mjmim
                        wrote on last edited by
                        #11

                        Hey Mark, I am looking into the DirectShow Editing Services and it seems quite interesting, I was already able to play an mpg file with it (after dividing its sound and video part according to the documentation! One question though, I am reading about the "Writing a Project to a File". Because eventually i am interested in having a mpg file in the end product. How exactly is it supposed to work if i do not have a multiplexer codec file from a third party? How does microsoft do the muxing of the uncompressed audio and video data? Thanks, Michael mjmimmm@hotmail.com

                        M 1 Reply Last reply
                        0
                        • M mjmim

                          Hey Mark, I am looking into the DirectShow Editing Services and it seems quite interesting, I was already able to play an mpg file with it (after dividing its sound and video part according to the documentation! One question though, I am reading about the "Writing a Project to a File". Because eventually i am interested in having a mpg file in the end product. How exactly is it supposed to work if i do not have a multiplexer codec file from a third party? How does microsoft do the muxing of the uncompressed audio and video data? Thanks, Michael mjmimmm@hotmail.com

                          M Offline
                          M Offline
                          Mark Salsbery
                          wrote on last edited by
                          #12

                          mjmim wrote:

                          How exactly is it supposed to work if i do not have a multiplexer codec file from a third party?

                          It won't, unfortunately. I believe because of licensing, Microsoft provides no encoders for MPEG-1,2,3. There is an encoder for MPEG-4 but the resulting file is wrapped in an ASF (.wma, .wmv, etc.) format "container". The only mux filter included is for AVI. The multiplexer for ASF format (which is actually part of the Windows Media Format SDK) is built-in to the WM ASF Writer filter. I guess I should have been more spcific in my first reply about what type of encoder you'd need. If you have encoding code it may be fairly easy to develop your own filter. I've developed and use a few custom filters but I've never done a mux/encode filter so I'm not sure what's involved. I suppose if you have encoder code (or a library) that takes raw timestamped audio and video input then it could be fairly easy. Mark

                          "If you can dodge a wrench, you can dodge a ball."

                          M 1 Reply Last reply
                          0
                          • M Mark Salsbery

                            mjmim wrote:

                            How exactly is it supposed to work if i do not have a multiplexer codec file from a third party?

                            It won't, unfortunately. I believe because of licensing, Microsoft provides no encoders for MPEG-1,2,3. There is an encoder for MPEG-4 but the resulting file is wrapped in an ASF (.wma, .wmv, etc.) format "container". The only mux filter included is for AVI. The multiplexer for ASF format (which is actually part of the Windows Media Format SDK) is built-in to the WM ASF Writer filter. I guess I should have been more spcific in my first reply about what type of encoder you'd need. If you have encoding code it may be fairly easy to develop your own filter. I've developed and use a few custom filters but I've never done a mux/encode filter so I'm not sure what's involved. I suppose if you have encoder code (or a library) that takes raw timestamped audio and video input then it could be fairly easy. Mark

                            "If you can dodge a wrench, you can dodge a ball."

                            M Offline
                            M Offline
                            mjmim
                            wrote on last edited by
                            #13

                            Hey Mark, I too have written quite a few transform filters. I have never written a multiplexer before, and certainly not a multiplexer for mpeg2. Do you have a direction to point me in for a open source multiplexing code or for a guideline as how to write such a thing? Do you have an estimate for how long it would take to write such a thing? thank you very much... Michael mjmimmm@hotmail.com

                            M 1 Reply Last reply
                            0
                            • M mjmim

                              Hey Mark, I too have written quite a few transform filters. I have never written a multiplexer before, and certainly not a multiplexer for mpeg2. Do you have a direction to point me in for a open source multiplexing code or for a guideline as how to write such a thing? Do you have an estimate for how long it would take to write such a thing? thank you very much... Michael mjmimmm@hotmail.com

                              M Offline
                              M Offline
                              Mark Salsbery
                              wrote on last edited by
                              #14

                              Michael, I have no idea how much work it would be. I've never worked with MPEG. Using DES, the render engine yields an uncompressed video stream and an uncompressed audio stream. If I had code to take those streams and make an MPEG file then a filter could be made to do that fairly easily. If I had to actually compress the data and build the file I wouldn't know where to start. Maybe these links will help for resources: The MPEG Home Page[^] MPEG Pointers and Resources[^] Mark

                              "If you can dodge a wrench, you can dodge a ball."

                              M 1 Reply Last reply
                              0
                              • M Mark Salsbery

                                Michael, I have no idea how much work it would be. I've never worked with MPEG. Using DES, the render engine yields an uncompressed video stream and an uncompressed audio stream. If I had code to take those streams and make an MPEG file then a filter could be made to do that fairly easily. If I had to actually compress the data and build the file I wouldn't know where to start. Maybe these links will help for resources: The MPEG Home Page[^] MPEG Pointers and Resources[^] Mark

                                "If you can dodge a wrench, you can dodge a ball."

                                M Offline
                                M Offline
                                mjmim
                                wrote on last edited by
                                #15

                                I have found a commercial Mpeg-2 multiplexer What type of Media subtype to i need to specify wheni set the output file? Name of function: SetOutputFileName They are many mpeg2 video subtypes..... Do you know which one? Thank you, Michael mjmimmm@hotmail.com

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups