<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 9/26/20 3:33 PM, Ross Boylan wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAK3NTRDOPG7_3Z_yhYnorCH41tDaQ64yCNwgcSTza+W9F=RmQQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>I had a US OTA TV recording that was working fine. Somehow
a transcode was triggered, the seek table became corrupt and
now it's not watchable. I have repaired the seek table in the
database (MariaDB) and regenerated the seek table for the
recording. But it still isn't usable, and my effort to
convert it back failed.</div>
<div><br>
</div>
<div><br>
</div>
<div>Any suggestions?</div>
<div><br>
</div>
<div>DETAILS</div>
<div>My effort to convert back (it's unclear to me if
mythtranscode can ever produce something in the original
format,</div>
<div>which was MPEG transport stream data):</div>
<div>mythtv@barley:~$ date; time mythtranscode -i $VID -o
${VID}.1 --mpeg2 --ostream ts<br>
Sat 26 Sep 2020 11:23:07 AM PDT<br>
2020-09-26 11:23:07.365745 C mythtranscode version: rb02
[v30.0-82-g541f52c2e4-dirty] <a href="http://www.mythtv.org"
moz-do-not-send="true">www.mythtv.org</a><br>
2020-09-26 11:23:07.365755 C Qt version: compile: 5.11.3,
runtime: 5.11.3<br>
.....<br>
2020-09-26 11:23:08.082933 N Transcoding from
/srv/media10/media10-barley/22002_20200215205800.ts to
/srv/media10/media10-barley/22002_20200215205800.ts.1<br>
2020-09-26 11:23:08.083343 I Opening
/srv/media10/media10-barley/22002_20200215205800.ts<br>
2020-09-26 11:23:08.100018 I Estimating duration from
bitrate, this may be inaccurate<br>
2020-09-26 11:23:08.100080 I Input #0, nuv, from
'/srv/media10/media10-barley/22002_20200215205800.ts':<br>
2020-09-26 11:23:08.100091 I Duration: 06:50:25.63, start:
86612.405000, bitrate: 1411 kb/s<br>
2020-09-26 11:23:08.100155 I Stream #0:0: Video: nuv
(RJPG / 0x47504A52), yuv420p, 704x480, SAR 40:33 DAR 16:9,
59.94 fps, 59.94 tbr, 1k tbn, 1k tbc<br>
2020-09-26 11:23:08.100186 I Stream #0:1: Audio: mp3
(LAME / 0x454D414C), 48000 Hz, stereo, fltp, 1411 kb/s<br>
2020-09-26 11:23:08.100246 W Warning: partial frame found!<br>
2020-09-26 11:23:08.100420 W Warning: partial frame found!</div>
<div>... many more of those</div>
<div>2020-09-26 11:23:08.306255 W Warning: partial frame found!<br>
Handling Floating point exception<br>
Floating point exception</div>
<div><br>
</div>
<div><br>
</div>
<div>The output file had 0 bytes.</div>
<div><br>
</div>
<div>The original recording was around 2.5 hours; it now shows
as 52 minutes when I go to view it and the conversion program
above estimates the length to be almost 7 hours.</div>
<div><br>
</div>
<div>Aside from the misestimated length of time the main problem
now is the audio, which is mostly a loud hiss with the voices
very slow behind that. But the video appears regular speed.
Before rebuilding the skip list, the video jumped from one
still frame to another. The audio problem may be from <a
href="https://code.mythtv.org/trac/ticket/13459"
moz-do-not-send="true">https://code.mythtv.org/trac/ticket/13459</a>
(my code may not have the fixes), which was one reason I was
trying to convert out of nuv format.<br>
</div>
<div><br>
</div>
<div>HISTORY</div>
<div><br>
</div>
<div>1. Transcoding</div>
<div><br>
</div>
<div>The original transcode was triggered inadvertently, I
assume, It did report some problems, likely from poor quality
of the original signal.</div>
<div>------------------------------------- transcode logs
(excerpts) ---------------------------------</div>
<div>2020-09-22 20:18:04.687235 N [31505/31505] CoreContext
main.cpp:556 (main) - Transcoding from
/srv/media10/media10-barley/22002_20200215205800.ts to
/srv/media10/media10-barley/22002_20200215205800.ts.tmp<br>
2020-09-22 20:18:04.824896 I [31505/31505] CoreContext
avformatdecoder.cpp:2222 (ScanStreams) - AFD: codec AC3 has 2
channels<br>
2020-09-22 20:18:04.824994 I [31505/31505] CoreContext
avformatdecoder.cpp:2771 (OpenAVCodec) - AFD: Opened codec
0x563d893cd1c0, id(AC3) type(Audio)<br>
2020-09-22 20:18:04.833747 I [31505/31505] CoreContext
avformatdecoder.cpp:2669 (ScanStreams) - AFD: Using ffmpeg for
video decoding<br>
2020-09-22 20:18:04.833802 I [31505/31505] CoreContext
avformatdecoder.cpp:2771 (OpenAVCodec) - AFD: Opened codec
0x563d89384e80, id(MPEG2VIDEO) type(Video)<br>
2020-09-22 20:18:04.833828 N [31505/31505] CoreContext
audioplayer.cpp:166 (ReinitAudio) - AudioPlayer: Enabling
Audio<br>
2020-09-22 20:18:04.866934 N [31505/31505] CoreContext
transcode.cpp:120 (GetProfile) - Transcode: Looking for
autodetect profile: Autodetect from 480p<br>
2020-09-22 20:18:04.951912 I [31505/31511] SendMessage
mythcorecontext.cpp:451 (ConnectCommandSocket) -
MythCoreContext::ConnectCommandSocket(): Connecting to backend
server: <a href="http://192.168.1.10:6543"
moz-do-not-send="true">192.168.1.10:6543</a> (try 1 of 1)<br>
2020-09-22 20:18:04.953804 I [31505/31511] SendMessage
mythcorecontext.cpp:1677 (CheckProtoVersion) -
MythCoreContext::CheckProtoVersion(): Using protocol version
91 BuzzOff<br>
2020-09-22 20:18:05.049724 N [31505/31505] CoreContext
transcode.cpp:145 (GetProfile) - Transcode: Using autodetect
profile: MPEG2<br>
2020-09-22 20:18:05.079692 N [31505/31505] CoreContext
transcode.cpp:817 (TranscodeFile) - Forcing Recorder option
'videocodec' to ''<br>
2020-09-22 20:18:05.079716 E [31505/31505] CoreContext
recorders/recorderbase.cpp:211 (SetOption) - RecBase[NULL]():
SetOption(): Unknown int option: videocodec: 0<br>
2020-09-22 20:18:05.136841 I [31505/31505] CoreContext
transcode.cpp:1084 (TranscodeFile) - Copying Audio while
transcoding Video<br>
2020-09-22 20:18:05.144283 I [31505/31511] VideoDecodeBuffer
mythcodeccontext.cpp:322 (InitDeinterlaceFilter) -
MythCodecContext: Disabled hardware decoder based
deinterlacer.<br>
2020-09-22 20:18:05.145705 E [31505/31505] CoreContext
mythsystemevent.cpp:345 (SendMythSystemRecEvent) -
MythSystemEventHandler: SendMythSystemRecEvent() called with
empty RecordingInfo<br>
2020-09-22 20:19:37.784950 E [31505/31511] VideoDecodeBuffer
avformatdecoder.cpp:5116 (ProcessAudioPacket) - AFD: Unknown
audio decoding error<br>
2020-09-22 20:21:03.982880 E [31505/31511] VideoDecodeBuffer
avformatdecoder.cpp:5116 (ProcessAudioPacket) - AFD: Unknown
audio decoding error<br>
2020-09-22 20:22:10.782730 E [31505/31511] VideoDecodeBuffer
avformatdecoder.cpp:5312 (GetFrame) - decoding error End of
file (-541478725)</div>
<div>------------------------- end transcode logs
--------------------------------------------</div>
<div>After waiting for the recording not to be in use, the old
version was replaced by the new one.</div>
<div><br>
</div>
<div>2. Seek table and database</div>
<div><br>
</div>
<div>Problems viewing the transcoded recording led to the
discovery there was no seek table for it.</div>
<div>Ran <a href="http://optimize_mythdb.pl"
moz-do-not-send="true">optimize_mythdb.pl</a>, but it hung
up when it got to the recordedseek table.<br>
</div>
<div><br>
</div>
<div>This led to the discovery the recordedseek table was
corrupt--i.e., the whole table, not just the info for that
show.</div>
<div>I think the ultimate cause was that the root partition,
which was being used for /tmp by mariadb, couldn't hold the <br>
</div>
<div>working files mariadb put there. I grew the partition.<br>
</div>
<div><br>
</div>
<div>-----------------------------------------------------------
SQL
------------------------------------------------------------------------------</div>
<div>check table recordedseek;<br>
MariaDB [mythconverg]> <br>
</div>
<div>+--------------------------+-------+----------+-------------------------------------------------------------+<br>
| Table | Op | Msg_type | Msg_text
|<br>
+--------------------------+-------+----------+-------------------------------------------------------------+<br>
| mythconverg.recordedseek | check | warning | Table is
marked as crashed and last repair failed |<br>
| mythconverg.recordedseek | check | warning | Size of
indexfile is: 1201630208 Should be: 1024 |<br>
| mythconverg.recordedseek | check | error | Found key at
page -1 that points to record outside datafile |<br>
| mythconverg.recordedseek | check | error | Corrupt
|<br>
+--------------------------+-------+----------+-------------------------------------------------------------+</div>
<div><br>
</div>
<div>repair table recordedseek;</div>
<div>+--------------------------+--------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+<br>
| Table | Op | Msg_type | Msg_text
|<br>
+--------------------------+--------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+<br>
| mythconverg.recordedseek | repair | Warning | Disk is full
writing '/tmp/ST08wgwF' (Errcode: 28 "No space left on
device"). Waiting for someone to free space... (Expect up to
60 secs delay for server to continue after freeing disk space)
|<br>
| mythconverg.recordedseek | repair | Warning | Retry in 60
secs. Message reprinted in 600 secs
|<br>
| mythconverg.recordedseek | repair | Warning | Retry in 60
secs. Message reprinted in 600 secs
|<br>
| mythconverg.recordedseek | repair | Warning | Retry in 60
secs. Message reprinted in 600 secs
|<br>
| mythconverg.recordedseek | repair | Warning | Retry in 60
secs. Message reprinted in 600 secs
|<br>
| mythconverg.recordedseek | repair | status | OK
|<br>
+--------------------------+--------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+<br>
6 rows in set (35 min 0.632 sec)<br>
</div>
<div>-- I realized the /tmp partition was the problem and
expanded it</div>
<div><br>
</div>
<div>+---------------------+<br>
| now() |<br>
+---------------------+<br>
| 2020-09-24 00:30:53 |<br>
+---------------------+<br>
1 row in set (0.001 sec)<br>
<br>
check table recordedseek;<br>
MariaDB [mythconverg]> <br>
</div>
<div>+--------------------------+-------+----------+----------+<br>
| Table | Op | Msg_type | Msg_text |<br>
+--------------------------+-------+----------+----------+<br>
| mythconverg.recordedseek | check | status | OK |<br>
+--------------------------+-------+----------+----------+</div>
<div><br>
</div>
<div>----------------------------------------------------------
end SQL------------------------------------------</div>
<div><br>
</div>
<div>The recordedseek table is extremely large on disk, a bit
over 1TB each for .MYD and .MYI files.</div>
<div>I gather it's expected to be large; I have about 10TB of
recordings. But the warning about the <br>
</div>
<div>expected size of the index file (namely ~1K) makes me
wonder if something has gone wrong.<br>
</div>
<div><br>
</div>
<div>The rebuild of the seek table used</div>
<div>mythcommflag --file
/srv/media10/media10-barley/22002_20200215205800.ts --rebuild</div>
<div>and reported success.</div>
<div><br>
</div>
<div><br>
</div>
</div>
</blockquote>
<p>My recommendation would be:<br>
</p>
<p>1. Clear the seektable for the recording -<br>
</p>
<p>mythutil --clearseektable --chanid "$chanid" --starttime
"$starttime"</p>
<p>2. repair the recording file with <br>
</p>
<p>mkvmerge -o outputfile.mkv originalfile.ts</p>
<p>3. replace the file with the repaired file</p>
<p>cp outputfile.mkv originalfile.ts</p>
<p>(keep a copy of the original file in case this makes things
worse)</p>
<p>If it still will not play, try playing the file with vlc. The
recording itself may be corrupt.<br>
</p>
<p>Peter<br>
</p>
<p><br>
</p>
</body>
</html>