MontysEvilTwin
Well-Known Member
Nicesplice is handy for removing adverts from recordings, but I have noticed that when the cropped files are played back on the HDR-FOX, the sound drops out for a few seconds after each join. If the dialogue starts quickly after a join it is sometimes necessary to leave a few seconds of the advert in to avoid sound loss (there is a work around, wait until the sound resumes and rewind to just after the join and then play). Also when played on other devices, the length of the recording is usually misreported and there can be problems when a join is reached (some players are better than others, Kodi is pretty good). These issues are caused by timestamps in the ts file and can be fixed by remuxing. If you just want to remux the video and main audio stream, this can be done on the unit itself with ffmpeg:
This is quick (no transcoding) and will fix the timestamps. It works for both MPEG2/ MP2 and H.264/ AAC recordings. If the file extension of the output file is then changed to ts (from m2ts) you can use the Sidecar package to create hmt and nts files for playback on the HDR-FOX with full transport controls.
Copying subtitles with ffmpeg was recently mentioned here. It is possible to copy additional streams using the map option with ffmpeg see here.
There seem to be up to four relevant streams in a DVB-T transmission, 0:0 (video), 0:1 (main audio),
0:2 (audio description or subtitle) and 0:3 (subtitle). If there are no subtitles, MPEG2 recordings tend
to have just two streams, with subtitles four: it seems there is a dummy audio stream at 0:2 if there is no audio description track. H.264 recordings have 3 or 4 streams, 3 if no audio description. For both MPEG2 and H.264 video, with audio description and subtitles the following can be used to copy the four streams into a new file:
The above can be adjusted depending on which streams you want to copy. For example, ffmpeg falls over if you try and copy an MPEG2 recording with a dummy audio description stream: in this case remove '-map 0:2' to stop ffmpeg attempting to copy that stream.
Copying true audio description streams works fine by this method, but subtitles are more challenging. Cropped files can sometimes cause ffmpeg to fall over when a subtitle track is included (see above post from xyz321). Also, with the version of ffmpeg on the HDR-FOX, the subtitles are copied but cannot be displayed due errors in the header. Both of these are known issues with ffmpeg for which a patch is available see here. I wonder if it is feasible to patch ffmpeg (or use a later version?) to solve this problem without affecting Detectads, for example? Or can more than one version of ffmpeg be incorporated into the custom firmware?
Code:
ffmpeg -i input.ts -c copy output.m2ts
Copying subtitles with ffmpeg was recently mentioned here. It is possible to copy additional streams using the map option with ffmpeg see here.
There seem to be up to four relevant streams in a DVB-T transmission, 0:0 (video), 0:1 (main audio),
0:2 (audio description or subtitle) and 0:3 (subtitle). If there are no subtitles, MPEG2 recordings tend
to have just two streams, with subtitles four: it seems there is a dummy audio stream at 0:2 if there is no audio description track. H.264 recordings have 3 or 4 streams, 3 if no audio description. For both MPEG2 and H.264 video, with audio description and subtitles the following can be used to copy the four streams into a new file:
Code:
ffmpeg -i input.ts -map 0:0 -map 0:1 -map 0:2 -map 0:3 -c copy output.m2ts
Copying true audio description streams works fine by this method, but subtitles are more challenging. Cropped files can sometimes cause ffmpeg to fall over when a subtitle track is included (see above post from xyz321). Also, with the version of ffmpeg on the HDR-FOX, the subtitles are copied but cannot be displayed due errors in the header. Both of these are known issues with ffmpeg for which a patch is available see here. I wonder if it is feasible to patch ffmpeg (or use a later version?) to solve this problem without affecting Detectads, for example? Or can more than one version of ffmpeg be incorporated into the custom firmware?
Last edited: