News:

--

Main Menu

Appending several files doesn't work

Started by tom1632, June 16, 2018, 02:25:58 PM

Previous topic - Next topic

tom1632

Hi,

I have several files which are serially numbered at the end: file-001.ts, file-002.ts, file-003.ts,....
In the past when I opened the first file I was asked if all these files should be opened and appended automatically.  Now just the first file will be opened and I have to append each single file manually which is quite time consuming. What can I do to get back the original behavior? I'm working with avidemux 2.7.1 and Ubuntu 18.04 - 64bit.

Thanks, Thomas

eumagga0x2a

Quote from: tom1632 on June 16, 2018, 02:25:58 PM
I have several files which are serially numbered at the end: file-001.ts, file-002.ts, file-003.ts,....
In the past when I opened the first file I was asked if all these files should be opened and appended automatically.

There are two ways to append sequential files, both very similar from the user perspective but fundamentally different in the implementation: auto-append in the demuxer and (manual) append in the editor. The former is mandatory for DVD video, the latter should be used for everything else. The auto-append for TS in the MpegTS demuxer didn't work right and was disabled for good.

QuoteNow just the first file will be opened and I have to append each single file manually which is quite time consuming.

Just select all files you are going to append and drag'n'drop them onto the Avidemux window in one go.

QuoteWhat can I do to get back the original behavior?

Replace #if 0 at https://github.com/mean00/avidemux2/blob/master/avidemux_plugins/ADM_demuxers/MpegTS/ADM_tsIndex.h#L47 with #if 1 and rebuild Avidemux.

But unless your TS files are fragments of a single stream (like VOBs on a video DVD), you will see that the feature is broken and thus unusable. If you could contribute a patch implementing a reliable detection of different streams vs. fragments of a single stream, you could have the best of both worlds :-)

tom1632

Many thanks for the fast reply. Drag&Drop works fine. In fact my ts-files are fragments of a single stream. Therefore I never had to face the problems you mentioned. But now I understand that auto-append was disabled.

Best regards, Thomas

eumagga0x2a

Quote from: tom1632 on June 18, 2018, 07:53:11 PM
In fact my ts-files are fragments of a single stream.

How do you know? Did they originate from an action cam like a GoPro, automatically split at 1GiB boundary? If concatenating the files like

cat file01.ts file02.ts file03.ts > appended.ts

and loading appended.ts in Avidemux results in a video of correct duration (not the duration of the last file but the sum of durations of the fragments), then they are indeed parts of a single stream.

tom1632

Well, my TS files come from a single source which cuts the video stream into 1 GB blocks. I'm very confident about this. I carried out your suggested test and the duration of append.ts is exactly the sum of the durations of each single fragment.

eumagga0x2a

Are the blocks exactly 1GiB (1.073.741.824 bytes) in size? If they are, this could be used as an indication that we should use binary append in the demuxer.

eumagga0x2a

I don't want to conceal that an answer to the question posed above would be highly appreciated.

tom1632

Sorry. I haven't forgotten but the the last days were very busy. The TS files (except the last one from each recording of course) have a size of 1.078.067.200 bytes. If you need any further information please ask.

eumagga0x2a

Thank you. It means, an easy heuristic to detect whether we should use binary append is not viable.