August 17, 2012

A.A.B.A A.A.B.A
Ant Farmer
60 posts

[Solved] How to merging media files with Qt?

 

Hi, I’m new to Qt and this forum, please treat me kindly.

I’m working with many media files that need to be merged together (ogg vorbis, for instance).

Is there any Qt Class that help me doing so? Like using cat:

  1. cat file1.ogg file2.ogg > file3.ogg

The result is a file contain sound from the other 2.

Many thanks for those who give me answer!

 Signature 

Alvis Ar’Berkeley Andrew.
Pleased to meet you!

3 replies

August 18, 2012

marcoB marcoB
Ant Farmer
167 posts

You can achieve this just with QFile [qt-project.org] class: create a file3.ogg then read both file1 and file2 while writing their content into file3.
You can also use QProcess [qt-project.org] to execute that command but this is OS dependant.

August 18, 2012

A.A.B.A A.A.B.A
Ant Farmer
60 posts

Thank you, deimos!

 Signature 

Alvis Ar’Berkeley Andrew.
Pleased to meet you!

September 29, 2012

hipersayan_x hipersayan_x
Lab Rat
31 posts

Be very careful, joining two or more videos as raw files not always works, not all video/audio formats accept a new data stream after it ends, and this method will not work with different formats.
The best way of achieving this, is transcoding the files with, for instance, FFmpeg [ffmpeg.org], you can run FFmpeg through QProcess [qt-project.org].

 Signature 

“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.”

“Finibus Bonorum Et Malorum”, CicerĂ³n

 
  ‹‹ How to use Qt to architect an interactive pretty print calculator interface      Combined splitterhandle for subwindows ››

You must log in to post a reply. Not a member yet? Register here!