-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difficulty in cutting h264 recordings #600
Comments
|
The problem occurs when 'ffmpeg' is cutting the wanted segments from the raw recording. They are much longer than intended. [john@HPFed Bashtests]$ ls -Llh /home/john/SGs/RecsSG3/20055_20220702074100raw.ts ionice -c3 mythffmpeg -hide_banner -ignore_unknown -noaccurate_seek -ss 4.9000 -t 54.8400 -i /home/john/SGs/RecsSG3/20055_20220702074100.ts -vcodec copy -acodec copy -avoid_negative_ts make_zero -f mpegts /var/RSG4/TScut_work/20055_20220702074100_184524_001.ts Working from the raw recording: ######### file /var/RSG4/TScut_work/20055_20220702074100_184524_001.ts File segments have been written, Concatenating. ionice -c3 mythffmpeg -hide_banner -ignore_unknown -fflags +genpts -f concat -safe 0 -i seglist_184524 -c copy /mnt/sdb1/Vids/20055_20220702074100_184524.ts I think the essential difference from the raw recording format is ' fflags +genpts ' |
|
Some thoughts came into my mind when reading this issue: In order to eliminate any impacts which might not be under control of MythTV,
Additional tweaks within MythTV which are worth to try:
In general, this issue does not provide detailed information for me about the |
|
Thank you for this very full response. I don't expect to try using many of the tools that you suggest soon, because my script now usually does what I want, but it's good to have the references. I created this Issue because it appears that the underlying cause has existed for years. In particular, my script logs for cutting h264 recordings often complain, as below. I had found no useful suggestions about how to "Fix my code". I'm not suggesting that there has been a reversion.
You asked about non-MythTV-compliant filenames. I rename input files so that the script output can replace the original. Thanks again. |
|
Another reference that might be relevant here: https://forum.mythtv.org/viewtopic.php?t=4400#p21724
|
|
A new aspect of this has come to light after a recent thread on the users list. Using a command line like apparently allowed a suggested cutting script to work when the 'outfile' had replaced the original recording. This has been reported earlier in several other contexts. It seemed worth trying the same procedure on the output of my old 'pycut.py' script, which simply copies and concatenates segments of the original recording, where the cuts are made at video keyframes. Direct playback had been mostly good, but usually with transients at the joins, where the timestamps jump. More recently I have used ffmpeg concatenation as outlined above; better but not perfect. So far my experience with this new scheme is limited, but the transients seem much less noticeable during playback with both mythfrontend and leanfront. As I have it at present both the 'pycutting' and the remuxing are followed by seektable rebuilds and other actions needed to create a replacement recording, but it ought to be possible to drop the first set, and possibly to use pipes instead of multiple large working files. My old scripts, in various states of revision, are still accessible through https://www.mythtv.org/wiki/MythDVBcut |
Platform:Fedora 35 x86_64
MythTV version:
Package version:mythtv-33.Pre.497.g8e36123478-100.fc35.x86_64.rpm
Component:
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
What is the expected behaviour?
What do you see instead?
Additional information
I have returned to my scripts using 'ffmpeg' to cut h264 recordings. I have one that usually gives results acceptable to me, but only after a preliminary run in which no cuts are applied. Without that step the cutting is wildly inaccurate. It isn't clear to me exactly what makes the difference; I think it's probably to do with the timestamps.
FWIW the same script behaves similarly with mpeg2 recordings, but for those I know about, and use, alternatives.
Here are brief stream analyses for the final, intermediate and initial files:
Final, after cutting:
ionice -c 3 mythffmpeg -hide_banner -i /home/john/SGs/RecsSG2/20055_20220629205800.ts
[h264 @ 0x55b4ef7adf00] mmco: unref short failure
Last message repeated 1 times
Input #0, mpegts, from '/home/john/SGs/RecsSG2/20055_20220629205800.ts':
Duration: 00:40:19.24, start: 1.400000, bitrate: 1172 kb/s
Stream #0:0[0x100]: Video: h264 (High), yuv420p(tv, bt470bg, top first), 544x576 [SAR 64:33 DAR 544:297], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:10x101: Audio: aac_latm (LC), 48000 Hz, stereo, fltp
At least one output file must be specified
#############
Intermediate., uncut:
ionice -c 3 mythffmpeg -hide_banner -i /home/john/SGs/RecsSG2/20055_20220629205800.ts_370262in.ts
[h264 @ 0x555f5c68cf00] mmco: unref short failure
Last message repeated 1 times
Input #0, mpegts, from '/home/john/SGs/RecsSG2/20055_20220629205800.ts_370262in.ts':
Duration: 01:05:57.82, start: 1.400000, bitrate: 1179 kb/s
Stream #0:0[0x100]: Video: h264 (High), yuv420p(tv, bt470bg, top first), 544x576 [SAR 64:33 DAR 544:297], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:10x101: Audio: aac_latm (LC), 48000 Hz, stereo, fltp
At least one output file must be specified
##################
As recorded:
ionice -c 3 mythffmpeg -hide_banner -i /home/john/SGs/RecsSG2/20055_20220629205800.ts_369556in.ts
[h264 @ 0x56079d5e4f00] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x56079d5e4f00] decode_slice_header error
[h264 @ 0x56079d5e4f00] no frame!
[h264 @ 0x56079d5e4f00] non-existing PPS 0 referenced
Last message repeated 1 times
There's a full page of this, then
[h264 @ 0x56079d5e4f00] decode_slice_header error
[h264 @ 0x56079d5e4f00] no frame!
[h264 @ 0x56079d5e4f00] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x56079d5e4f00] decode_slice_header error
[h264 @ 0x56079d5e4f00] no frame!
[h264 @ 0x56079d5e4f00] mmco: unref short failure
Last message repeated 1 times
[mpegts @ 0x56079d5e0e00] start time for stream 2 is not set in estimate_timings_from_pts
[mpegts @ 0x56079d5e0e00] stream 2 : no TS found at start of file, duration not set
[mpegts @ 0x56079d5e0e00] Could not find codec parameters for stream 2 (Audio: aac_latm, 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from '/home/john/SGs/RecsSG2/20055_20220629205800.ts_369556in.ts':
Duration: 01:05:57.82, start: 59402.916156, bitrate: 1192 kb/s
Stream #0:0[0x1d4d]: Video: h264 (High), yuv420p(tv, bt470bg, top first), 544x576 [SAR 64:33 DAR 544:297], 24.92 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:10x1d4e: Audio: aac_latm (LC), 48000 Hz, stereo, fltp
Stream #0:20x1d52: Audio: aac_latm, 0 channels, fltp
Stream #0:30x1d51: Subtitle: dvb_subtitle
At least one output file must be specified
###########
The text was updated successfully, but these errors were encountered: