Opened 14 years ago
Closed 13 years ago
#9389 closed Bug Report (fixed)
MythArchive and Project-X: cutlist translation
Reported by: | Owned by: | paulh | |
---|---|---|---|
Priority: | minor | Milestone: | 0.25 |
Component: | MythTV - General | Version: | 0.24 |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
Something, presumably a subtle change in DB schema for 0.24, has broken the code in MythArchive? that translates a Myth cutlist into one suitable for use by Project-X. I think I know what's wrong, but I'm not fluent in Python and it would be better if it was recoded by someone else.
Project-X requires a single cutlist in which all transition points are listed in sequence, with the first being a cut-in. MythTV stores cut-in and cut-out points separately, but an ordered merged list can be produced, as can ordered lists of each type. If the first element in the merged list is the same as the first element in the cut-out list, that element is a cut-out and must be the second in the list passed to Project-X. A leading zero must therefore be added to the merged list.
In mythburn.py the elements in the list are framecounts. In the mythcutprojectx script (wiki) they are bytecounts. The same arguments apply to both. I don't really speak bash either!
I've mentioned this in several places, most recently in #9377, but it's really a separate issue.
##################################
#list1 shows cut-out points. In 0.23 fixes an initial zero here is a cut-in.
list1=`echo "select mark from recordedmarkup
where chanid=$chanid and starttime='$starttime' and type=1 order by mark;" |
mysql -N -u mythtv -p$PASSWD mythconverg `
##################################
# and this gives the merged list
list=`echo "select mark from recordedmarkup where chanid=$chanid and starttime='$starttime' and type in (0,1) order by mark;" |
mysql -N -u mythtv -p$PASSWD mythconverg `
####################################
Attachments (3)
Change History (18)
comment:1 Changed 14 years ago by
Owner: | set to paul-h |
---|---|
Status: | new → assigned |
comment:2 Changed 14 years ago by
Owner: | changed from paul-h to paulh |
---|
comment:3 Changed 14 years ago by
comment:4 Changed 14 years ago by
Owner: | changed from paulh to sphery |
---|---|
Status: | assigned → accepted |
Version: | Unspecified → 0.24 |
comment:5 Changed 14 years ago by
I've modified mythcutprojectx in line with the suggestions above. It seems ok here but I haven't tried a downloaded copy yet. It ought to be quite easy to switch behaviour to fit the local DB schema - ISTR that the original ~2006 version did that.
Changed 14 years ago by
Attachment: | cutlisttrans.txt added |
---|
comment:6 Changed 14 years ago by
Attaching a suggested replacement for generateProjectXCutlist in mythburn.py for 0.24 I haven't tested it and the python syntax (type of firstcut, firstedit?) may be suspect but I think the logic is ok
comment:8 Changed 14 years ago by
I've now tested MythArchive? in 0.24-fixes with the above attachment, as modified by comment 7. The sense of cut is correct and the positional accuracy seemed as good as usual with Project-X, which often reports that it is 'dropping useless B-frames'. I tested only with a recording already processed by Project-X and having only one video stream and one mp2 stereo stream, and I used a version of mythburn.py that included most of the tweaks from Ticket #8376. None of these is likely to invalidate the cutlist tests.
I did three tests, with wanted segments at the start, in the middle, and at the end of the recording.
There is another change in the 0.24 cutlists that seems not to affect their use here but might perhaps be significant in 'confusing' the editor: the EOF is no longer returned as a cutpoint.
comment:9 Changed 14 years ago by
In SHA1: 32839c314e837e1e2644cdeee01af591e1cacc4b
Simplify string-based summary output of cut lists.
This patch modifies the generation of string-based cut list summaries (as provided by mythcommflag --getcutlist) so that they specify the beginning and end of recording for cut-to-beginning and cut-to-end cuts (as was done for previous versions of MythTV). Since the string summaries do not specify mark types, this makes parsing easier for applications that try to use summary data.
Also, don't load placeholder marks in ProgramInfo::QueryCutList?(). The database should never contain placeholders, so no need to load them.
Refs #9389.
comment:10 Changed 14 years ago by
Simplify string-based summary output of cut lists.
This patch modifies the generation of string-based cut list summaries (as provided by mythcommflag --getcutlist) so that they specify the beginning and end of recording for cut-to-beginning and cut-to-end cuts (as was done for previous versions of MythTV). Since the string summaries do not specify mark types, this makes parsing easier for applications that try to use summary data.
Also, don't load placeholder marks in ProgramInfo::QueryCutList?(). The database should never contain placeholders, so no need to load them.
Refs #9389.
Changeset: 32839c314e837e1e2644cdeee01af591e1cacc4b
comment:11 Changed 14 years ago by
Owner: | changed from sphery to paulh |
---|---|
Status: | accepted → assigned |
Passing back to Paul for the Python code.
Changed 14 years ago by
Attachment: | mythplugins-9389-fix_mytharchive_generateProjectXCutlist.patch added |
---|
Patch created using generateProjectXCutlist from cutlisttrans.txt
comment:12 Changed 14 years ago by
I attached mythplugins-9389-fix_mytharchive_generateProjectXCutlist.patch , which is a patch created by replacing the generateProjectXCutlist definition in mythplugins/mytharchive/mythburn/scripts/mythburn.py with the one from from cutlisttrans.txt . I left the end-of-line spaces, because I didn't know if they're required (especially in the SQL statements).
I haven't tested the patch, but made this a real patch primarily so that it's easier for a dev who knows Python and MythArchive?'s Python scripts to see exactly what changes had been proposed.
comment:13 Changed 14 years ago by
This patch still includes the typo that I corrected in comment 7 above. The mysql syntax is wrong because I omitted an equals sign in what will now be line 2021. It should read:
AND type=1 ORDER BY mark LIMIT 1 """ % (chanid, starttime)
Changed 14 years ago by
Attachment: | mythplugins-9389-fix_mytharchive_generateProjectXCutlist.2.patch added |
---|
Updated with typo fix from comments 7 and 13
comment:14 Changed 14 years ago by
Please see #10071 for a combination of this and other patches to mythburn.py
comment:15 Changed 13 years ago by
Milestone: | unknown → 0.25 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
MythArchive?: Convert to use the python bindings and a few other fixes
- Convert mythburn.py to use the python bindings (based on an original patch from Raymond Wagner. Among other things this fixes the cut list being reversed after changes elsewhere in Myth. Fixes #9389.
- Always convert the audio tracks to ac3. This fixes at last one instance of the audio dropping out part way through a DVD. Also our internal player gets very confused if a DVD has different codecs used by the into, menus and titles.
- Switch to use mythffmpeg rather than an external version of ffmpeg.
- Other stuff I've long since forgot about :) Branch: master Changeset: c5aca5cf4f3690c95a7d4a4a64c7ec0f6ec56dce
The reason I was reluctant to create a patch for either of these scripts was that I wasn't sure of the best way to select the first value from the list in either language. But mysql can do it; just add 'limit 1' to the two mysql queries quoted above and test for equality. HTH.