News:

--

Main Menu

Remuxing an m2v and mp2 file

Started by BPak, April 03, 2018, 04:36:13 AM

Previous topic - Next topic

BPak

I have been using version 2-4-4 avidemux for long time and could use ProjectX to clean up and seperate a .ts file ino a seperte Video and Audio file.

I do not see the same options available in version 2-6.

Is there a help file anywhere that can show me how to remux these files with Avidemus 2.6?

Jan Gruuthuse

#1
Re-muxing not re-encoding: use [Copy] in  Video and Audio Output
Select appropriate Container Format in Output Format like Mkv Muxer, ...

Mpeg2 (ff) involves re-encoding selectable in Video Output

m2v is not an option

eumagga0x2a

2.6. is long as EOL, please use the latest nightly as the latest release 2.7.0 is quite outdated too.

Please explain what you are actually trying to do. Avidemux is not ProjectX and thus won't repair partially corrupted MpegPS / MpegTS streams with MPEG-2 video, its purpose is to cut valid streams either losslessly in copy mode or reencoding using a variety of codecs.

If all you have are elementary streams (separate video and audio streams without a container) produces by ProjectX, you have lost, Avidemux doesn't support such streams. You need the original transport stream (.ts) or program stream (.mpg). Maybe ffmpeg is able to do this, try

ffmpeg -fflags +genpts -i video.m2v -i audio.mp2 -c copy output.mpg

BPak

I use TV to capture a show to disc. It saves it usually in a .ts format.
I use ProjectX to run this .ts file through its Demux.
This is said to remove bad frames and separate the Movie to m2v file and the Audio o mp2 file which allows the two files to be rejoined without the errors.
ProjectX also say that it keeps the frames in context with DVD requirements as a TV broadcast does not do this.

I have used the Avidemux 2.4.4 program to join (remux) these two files.
In Avidemux 2.4.4 we select the m2v file and go to the Audio menu option and select mp3 and select the mp2 file.
We then have it set to Copy for both settings and to go into a MPEG PS container and save the combines file.
From there we load this new file into Avidemux and cut it and then convert to AVI container.
Works exceptionally well. but new codexs turn up and we have to really look to Avidemux 2.6.
Hope that explains the process and what we have been using.
Thank you for your help.

eumagga0x2a

Quote from: BPak on April 03, 2018, 09:59:34 PM
ProjectX also say that it keeps the frames in context with DVD requirements as a TV broadcast does not do this.

This is mostly impossible without reencoding.

Again, if the m2v file is an elementary stream and not a program stream, you won't be able to load it in Avidemux 2.6 and later. If you don't have the original .ts anynore, try your luck with ffmpeg as mentioned above.

Apart from that, nothing changed, you can still load a video in Avidemux, add an external audio in the "Audio" --> "Select Tracks" menu and mux them together.

QuoteFrom there we load this new file into Avidemux and cut it and then convert to AVI container.
Works exceptionally well.

AVI is pretty much the worst possible choice.

Quotebut new codexs turn up and we have to really look to Avidemux 2.6.

Avidemux 2.6.x is EOL, it doesn't get any fixes or improvements. There should not be a reason apart from running an outdated operating system like Windows XP to use it instead of 2.7.0 (better the latest nightly).

BPak

Yes your ffmpeg code did put the m2v and mp2 files back together ok.
They run in VCL and Windows Media Player ok.
However, when opening the mpg file in Avidemux 2.6 the sound is out of sync.
Opening the mpg file in Avidemux 2.4 everything is OK.

Apart from that, nothing changed, you can still load a video in Avidemux, add an external audio in the "Audio" --> "Select Tracks" menu and mux them together.

What file extension can be used for this?

OK - I will get Avidemux 2.7

eumagga0x2a

Quote from: BPak on April 04, 2018, 04:49:44 AM
Yes your ffmpeg code did put the m2v and mp2 files back together ok.
They run in VCL and Windows Media Player ok.
However, when opening the mpg file in Avidemux 2.6 the sound is out of sync.

If the A/V offset remains constant throughout the video, just check the audio shift checkbox and find a value which works best. Avidemux 2.6.x and later versions rely on presentation timestamps (PTS) provided by the container in order to be able to handle modern codecs while earlier versions just counted frames. This is the reason I added -fflags +genpts to the ffmpeg command line. If it does not work right, you might try to omit these options and look how it fares.

If the A-V-delta grows, only the original .ts will help.

Quote
QuoteApart from that, nothing changed, you can still load a video in Avidemux, add an external audio in the "Audio" --> "Select Tracks" menu and mux them together.

What file extension can be used for this?

I don't think file name extension matters.

QuoteOK - I will get Avidemux 2.7

The latest nightly, please. It has dozens of issues fixed in comparison with Avidemux 2.7.0 release, which is 8 months old. This is pretty much for an actively developed application.

Jan Gruuthuse

Don't forget 2.4.4 was a frame based editor, 2.6 onwards avidemux is time based editor, due to the newer codecs.

BPak

#8
QuoteIf the A/V offset remains constant throughout the video, just check the audio shift checkbox and find a value which works best. Avidemux 2.6.x and later versions rely on presentation timestamps (PTS) provided by the container in order to be able to handle modern codecs while earlier versions just counted frames. This is the reason I added -fflags +genpts to the ffmpeg command line. If it does not work right, you might try to omit these options and look how it fares.

If the A-V-delta grows, only the original .ts will help.

-600 worked fine in my first attempt. Was in sync all the way. ProjectX is supposed to make that happen when it demuxes into two files.
Will do more testing on this process. Originally the ts files used to have breakups and resulted in sound async issues and that is why we went to ProjectX.
I will make a small program to run the ffmpeg file (saves all the typing).
I noticed in the documents a section on working on ts files that are corrupted by using other programs.
QuoteMpeg-TS will be considered perfect, i.e. there will be no correction for dropped or damaged packets. It means that if your captured stream is not perfect you will have async problems. In that case, better to use another tool, such as mencoder or transcode.

If you happen to have a non perfect Mpeg-Ts stream or a mpeg-PES (such as the ones generated by some DVB cards), you can try to use replex to convert them to a proper mpeg PS stream.
Also on research noticed that ffmpeg was favoured over mencoder.

QuoteThe latest nightly, please. It has dozens of issues fixed in comparison with Avidemux 2.7.0 release, which is 8 months old. This is pretty much for an actively developed application.

Regarding the new avidemux release 27 March if I remember is the one I installed.

QuoteDon't forget 2.4.4 was a frame based editor, 2.6 onwards avidemux is time based editor, due to the newer codecs.
Did not know this change had happened.!
Thanks for the info and help!