Generally I can nicely edit big .TS files but I have one that won't resave .TS

Started by mshiels, March 06, 2020, 04:40:21 PM

Previous topic - Next topic

mshiels

I am generally editing OTA braodcasts to remove commercials and have not had any problems but with a big 25M+ file it saves as a '0' byte .TS file almost instantly which is a bit of a probem, since by then I had spent the 5-10 minutes editing out the commercials.
if I try to save before I have edited - it seems to work fine.  But once I edit things I can not save the output at all.

can't save a print screen of my settings but the only thing i change from default is to use

output Format:

Mpeg TS Muxed (ff)


I can do what ever is needed to get information for debugging this

TRIED to post Mediainfo but then it considers this message spam

eumagga0x2a

What Avidemux version on which of multiple supported platforms do you use? If it is Windows, please delete the corresponding *.idx2 file, load the problematic MPEG-TS source video, reproduce the issue, close Avidemux, then compress (zip or 7z) and attach to your reply the file "admlog.txt" from %localappdata%\avidemux\

Does the problem persist with the latest available nightly? --> https://avidemux.org/nightly/

Deleting portions from within a H.264 or HEVC stream is often not viable or at least not cleanly doable due to specific codec features used by broadcasters to produce such streams.

Quote from: mshiels on March 06, 2020, 04:40:21 PM
I am generally editing OTA braodcasts to remove commercials and have not had any problems but with a big 25M+ file it saves as a '0' byte .TS file almost instantly which is a bit of a probem, since by then I had spent the 5-10 minutes editing out the commercials.

You should use the "save as project" feature to preserve the effort put into identifying cut points. By the way, you should be able to load the last state of editing anyway, even if you closed the application in-between (but not when you already a file manually).

QuoteTRIED to post Mediainfo but then it considers this message spam

If CleanTalk keeps blocking (please post only the textual output, no screenshots), please send it by PM, thanks.

mshiels

I am using the AviDemux_2.7.5 VC++ most recent build 200215 build I think, checking, yup, latest build.

So I nuked things, redid and attached the .zip

mshiels

And some background - I am using this to create decent copies of OTA movies that I keep in my archive.  Generally good quality since uncompressed and HD or HD+ format usually.

Run through a script I did that use CCExtract to get the EIA closed captions into SRT format.

Then MKVMerge(d) back into a nice MKV with the original stuff includig EIA closed captions, but also a nicely accessible SRT caption which Plex and my NVidia Shield TV will deal with nicely instead of requiring transcoding.

Honestly I have done tons and tons of movies this way and this is the first one with problems.  HATS OFF!!!  I do cutting at I frames only so pretty simple/basic usage I am sure, but it's been flawless for meuntil this one.!!

SCRIPT I USE BELOWVVVVV

C:\CCExtractor\CCExtractorWin "%~1" -o "%~dpn1.en.srt"
IF EXIST "%~dpn1.en.srt" GOTO GotIt

"C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%~dpn1.mkv" "%~1"

GOTO Done


:GotIt

CALL :SetSize "%~dpn1.en.srt"

IF %Size% GTR 3 GOTO GotItBigEnough:

"C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%~dpn1.mkv" "%~1"

GOTO Done


:GotItBigEnough

"C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%~dpn1.mkv" "%~1" --language 0:eng --default-track 0:0 "%~dpn1.en.srt"


:Done
DEL "%~dpn1.en-us.srt"
DEL "%~dpn1.en.srt"
DEL "%~dpn1.es.srt"
MOVE "%~1" "%~1z"
GOTO :EOF

:SetSize
SET Size=%~z1
GOTO :EOF

eumagga0x2a

Thank you for the log, the direct cause of the failure to save the video is a wrong value of PTS-DTS delta (the maximum difference of presentation and decode timestamps):

[ADM_EditorSegment::removeChunk] 18:19:43-435 Cutting from 0 to 2092 ms
Segment :0/1
Reference    :0    00:00:00,000
startLinear  :00000000 00:00:00,000
duration     :10797649067 02:59:57,649
refStartPts  :00000000 00:00:00,000
refStartDts  :00123900 00:00:00,123
[ADM_EditorSegment::removeChunk] 18:19:43-435 Start, seg 0 Offset :0 ms
[ADM_EditorSegment::removeChunk] 18:19:43-435 End  , seg 0 Offset :2092544 ms
Segment :0/1
Reference    :0    00:00:00,000
startLinear  :00000000 00:00:00,000
duration     :10795556523 02:59:55,556
refStartPts  :02092544 00:00:02,092
refStartDts  :02125900 00:00:02,125
[ADM_Composer::checkCutIsOnIntra] 18:19:43-435 Checking whether cut at 00:00:00,000 is on a keyframe...
[ADM_Composer::switchToSegment] 18:19:43-435 Trying to switch to seg 0 with startTime in reference pic= 2092 ms
[ADM_Composer::seektoTime] 18:19:43-435 Seeking to a keyframe at 2092 ms
[ADM_Composer::seektoTime] 18:19:43-435 Seeking to frame 60 at 2092 ms
[ADM_Composer::seektoTime] 18:19:43-435 Seek to time without decoding ok
[ADM_Composer::switchToSegment] 18:19:43-435 Switched ok to segment 0 (dontdecode=1)
[ADM_Composer::checkSegmentStartsOnIntra] 18:19:43-435 seg 0: ref 0, refDTS=2125900
[ADM_Composer::checkSegmentStartsOnIntra] 18:19:43-435 seg 0: ref 0, imgDTS=2125900
[A_ResetMarkers] 18:19:43-435 Video Total duration : 02:59:55,556 ms
[ADM_Composer::setMarkerBPts] 18:19:43-435 Selection's end point set to 02:59:55,556 (10795556523 us)
[ADM_Composer::seektoTime] 18:19:43-437 Image found in cache, pts=2092 ms, last sent frame: 63
[ADM_Composer::goToTimeVideo] 18:19:43-437 Seek done, in reference, gone to 2092544 with segment start at 2092544
[HandleAction] 18:19:47-035 ************ SAVE_VIDEO **************
[admSaver::admSaver] 18:19:51-268 [Save] Encoder index=0
[admSaver::save] 18:19:51-268 Audio starting time 00:00:00,000
[admSaver::save] 18:19:51-268 [A_Save] Saving..
[ADM_Composer::checkCutsAreOnIntra] 18:19:51-268 Checking cuts start on keyframe..
[ADM_EditorSegment::convertLinearTimeToSeg] 18:19:51-268 End of last segment
[checkCodec] 18:19:51-268 Codecs identified by isMpeg12Compatible() as matching
[admSaver::setupVideo] 18:19:51-268 Simple copy mode engaged
[ADM_videoStreamCopy::ADM_videoStreamCopy] 18:19:51-268 Creating copy video stream, start time: 00:00:00,000
[ADM_videoStreamCopy::ADM_videoStreamCopy] 18:19:51-268 End time: 02:59:55,556
[ADM_EditorSegment::convertLinearTimeToSeg] 18:19:51-268 End of last segment
[ADM_Composer::getTimeBase] 18:19:51-268 Timebase set to 1001 / 30000
[ADM_Composer::getFrameNumFromPtsOrBefore] 18:19:51-268 Best candidate for time 00:00:02,092 in reference is frame 60
[ADM_videoStreamCopy::ADM_videoStreamCopy] 18:19:51-268 PTS/DTS delta=18446744073709518260 us
[ADM_videoStreamCopy::ADM_videoStreamCopy] 18:19:51-268 Dts is too early, delaying everything by 18446744073709518260 us


The source video seems to be corrupted at many locations, maybe due to transmission errors. This might be the trigger for that crazily huge PTS-DTS delta value, but it is not easy to identify the exact path how we arrive at this erroneous value. Could you please provide the first 100 MiB of the source TS file as a sample?

By the way, you don't need to delete anything if you just want to start saving at an offset. You should simply place the marker A at this location.

eumagga0x2a

I've pushed a patch to git repository which might help to mitigate the impact of timing irregularities in the source video, but only a sample would allow to understand exactly what is going on here.

mshiels

Very possible that there is corruption, since it's an OTA recording.  Pretty sure my antenna needs some rediirection but I'm not climbing up for it!!  But yes any attempt to deal with the data is good.   I'll see if I can grab a chunk of the file from the front, but am pulling a bit of a brain fart here trying to split a binary file on Windows. 

eumagga0x2a

You could install MSYS2 and get the whole trove of Unix file and text handling utilities to your disposal. Alternatively, you could use a utility like HJSplit.

mshiels

I always used to have MKS toolkit on my boxes, but yes installed MSYS2 and used dd to grab a chunk of that file from the start.   So the question is there to put it, I don't have any upload places for a big binary sorry to say.

eumagga0x2a

Please use WeTransfer (no email address required despite the website trying to suggest otherwise!), Mega, Dropbox or Google Drive, thanks.

mshiels

WeTransfer is an interesting service - hopefully this is the first 100,000,000 bytes of my ts file - https://we.tl/t-rXhf6Ib7Pg

mshiels

And I just quickly tried the most recent build from Mar 14th

---------------------------
Info
---------------------------
<big><b>Too short</b></big><br><br>The saved video is incomplete. The error occured at 01:10:43,556 (40). This may happen as result of invalid time stamps in the video.
---------------------------
OK   
---------------------------

So the tweak got it to save more then '0' but all I was doing was editing up to the around 10 minute mark - so nothing around 1 hour and 10 minutes. 

eumagga0x2a

Thanks, but first of all, the duration of the sample is only 41 seconds and the stream is full of errors. I can save the sample in copy mode (obviously, including all the errors), but I would not recommend to do so. I would deinterlace it and re-encode if possible.