Skip to content
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

Mythburn.py error while extracting thumbnail image from stream.mv2 #615

Closed
bshanteau opened this issue Jul 28, 2022 · 12 comments
Closed

Mythburn.py error while extracting thumbnail image from stream.mv2 #615

bshanteau opened this issue Jul 28, 2022 · 12 comments

Comments

@bshanteau
Copy link

bshanteau commented Jul 28, 2022

  • Platform:
    Linux dvr 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

  • MythTV version:
    2:32.0+fixes.202207271103.f458821fa0~ubuntu20.04.1

  • Package version:
    PPA: mythbuntu/32

  • Component:
    mythburn.py

What steps will reproduce the bug?

MythFrontend->Utilities->Archive Files->Create DVD ->Select Destination: File: Make ISO Image->DVD Menu Theme: Simple-Autoplay->Select Archive Items: Add File-->Select short mp4 recording->Next

How often does it reproduce? Is there a required condition?

Only with mp4 recordings as far as I can tell

What is the expected behaviour?

Create iso file without menu, thus without thumbnails

What do you see instead?

Using simple_fix_rtl
mythburn.py (0.2.20200122-1) starting up...
script path:/usr/share/mythtv/mytharchive/scripts
myth share path:/usr/share/mythtv
passed job file: /storage/mytharchive/config/mydata.xml
passed progress log file: /storage/mytharchive/logs/progress.log
mythburn.py (0.2.20200122-1) starting up...
Found 4 CPUs
Obtaining MythTV settings from MySQL database for hostname dvr
temppath: /storage/mytharchive/work
logpath: /storage/mytharchive/logs
Setting process priority to 10
Setting ionice level to idle
Processing Mythburn job number 1.
Options - mediatype = 3, doburn = 1, createiso = 1, erasedvdrw = 0
savefilename = '/storage/mytharchive/p-r.iso'
Looking for: /usr/share/mythtv/mytharchive/themes/Simple_-_Autoplay/theme.xml
Loading font 0, /usr/share/mythtv/fonts/FreeSans.ttf size 19
Loading font 1, /usr/share/mythtv/fonts/FreeSans.ttf size 15
Loading font 2, /usr/share/mythtv/fonts/FreeSans.ttf size 13
wantIntro: 0, wantMainMenu: 0, wantChapterMenu: 0, wantDetailsPage: 0
Final DVD Video format will be ntsc
There are 1 file(s) to process
Pre-processing file 1: '/storage/mytharchive/10787_20210108140000.mp4'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/mytharchive/10787_20210108140000.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:01:24.08, start: 0.100000, bitrate: 3574 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 3178 kb/s, 59.95 fps, 59.94 tbr, 90k tbn, 119.88 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Side data:
audio service type: main
/storage/mytharchive/work/1/streaminfo.xml:-

<?xml version="1.0" ?><!DOCTYPE FILEINFO><file duration="84" cutduration="84" filename="/storage/mytharchive/10787_20210108140000.mp4" type="mov,mp4,m4a,3gp,3g2,mj2">    
        <streams count="2">        
                <video streamindex="0" ffmpegindex="0" bitrate="3178701" fps="59.9401" width="1280" aspectratio="1.77778" start_time="0.9000" height="720" codec="h264 (High) (avc1 / 0x31637661)" id="1"/>        
                <audio streamindex="1" ffmpegindex="1" bitrate="384000" channels="6" samplerate="48000" language="eng" start_time="0.9312" codec="ac3 (ac-3 / 0x332D6361)" id="2"/>        
        </streams>    
</file>

Node = chanid, Data =
Node = type, Data = file
Node = filename, Data = /storage/mytharchive/10787_20210108140000.mp4
Node = title, Data = /storage/mytharchive/10787_20210108140000.mp4
Node = recordingdate, Data =
Node = recordingtime, Data =
Node = subtitle, Data =
Node = description, Data =
Node = rating, Data =
Node = coverfile, Data =
Node = cutlist, Data =
Video resolution is 1280 by 720
*************************************************************
Processing file 1: '/storage/mytharchive/10787_20210108140000.mp4'
*************************************************************
File type is 'mov,mp4,m4a,3gp,3g2,mj2'
Video codec is 'h264 (High) (avc1 / 0x31637661)'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/mytharchive/10787_20210108140000.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:01:24.08, start: 0.100000, bitrate: 3574 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 3178 kb/s, 59.95 fps, 59.94 tbr, 90k tbn, 119.88 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Side data:
audio service type: main
/storage/mytharchive/work/1/streaminfo.xml:-

<?xml version="1.0" ?><!DOCTYPE FILEINFO><file duration="84" cutduration="84" type="mov,mp4,m4a,3gp,3g2,mj2" filename="/storage/mytharchive/10787_20210108140000.mp4">    
        <streams count="2">        
                <video bitrate="3178701" fps="59.9401" width="1280" aspectratio="1.77778" id="1" height="720" start_time="0.9000" streamindex="0" ffmpegindex="0" codec="h264 (High) (avc1 / 0x31637661)"/>        
                <audio bitrate="384000" channels="6" id="2" samplerate="48000" language="eng" start_time="0.9312" streamindex="1" ffmpegindex="1" codec="ac3 (ac-3 / 0x332D6361)"/>        
        </streams>    
</file>

Preferred audio languages eng and eng
Video id: 0x1, Audio1: [1] 0x2 (AC3 (AC-3 / 0X332D6361), eng), Audio2: [-1] - 0x-1 (N/A, N/A)
Aspect ratio is 16:9
Re-encoding audio and video
Using encoder profiles from /usr/share/mythtv/mytharchive/encoder_profiles/ffmpeg_dvd_ntsc.xml
Encoding profile (LP) found
mythffmpeg -threads 4 -v 1 -i "/storage/mytharchive/10787_20210108140000.mp4" -r ntsc -target ntsc-dvd -b:v 2344k -s 352x480 -acodec ac3 -b:a 192k -ac 2 -aspect 16:9 "/storage/mytharchive/work/1/newfile2.mpg" -map 0:0 -map 0:1
[mpeg @ 0x5560cb672180] start time for stream 0 is not set in estimate_timings_from_pts
Input #0, mpeg, from '/storage/mytharchive/work/1/newfile2.mpg':
Duration: 00:01:24.15, start: 0.533367, bitrate: 2176 kb/s
Stream #0:0[0x1bf]: Data: dvd_nav_packet
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 352x480 [SAR 80:33 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Side data:
cpb: bitrate max/min/avg: 9000000/0/0 buffer size: 1835008 vbv_delay: N/A
Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
storage/mytharchive/work/1/streaminfo.xml:-

<?xml version="1.0" ?><!DOCTYPE FILEINFO><file cutduration="84" duration="84" type="mpeg" filename="/storage/mytharchive/work/1/newfile2.mpg">    
        <streams count="3">        
                <data streamindex="0" codec=""/>        
                <video width="352" id="480" start_time="0.48003" streamindex="1" ffmpegindex="0" height="480" codec="mpeg2video (Main)" bitrate="0" fps="29.97" aspectratio="1.77778"/>        
                <audio id="128" start_time="0.55983" streamindex="2" channels="2" ffmpegindex="1" codec="ac3" language="N/A" bitrate="192000" samplerate="48000"/>        `
        </streams>    
</file>

Preferred audio languages eng and eng
Video id: 0x1e0, Audio1: [1] 0x80 (AC3, N/A), Audio2: [-1] - 0x-1 (N/A, N/A)
Splitting MPEG stream into audio and video parts
Running: mythreplex --demux --fix_sync -o "/storage/mytharchive/work/1/stream" -v 224 -c 128 "/storage/mytharchive/work/1/newfile2.mpg"
Audio is already in ac3 format
Extracting thumbnail image from /storage/mytharchive/work/1/stream.mv2 at position 10
Destination file /storage/mytharchive/work/1/title.jpg
Segmentation fault (core dumped)
************************************************************
ERROR: Failed while running mytharchivehelper to get thumbnails.
Result: 139, Command was mytharchivehelper -q -q --createthumbnail --infile "/storage/mytharchive/work/1/stream.mv2" --thumblist '10' --outfile "/storage/mytharchive/work/1/title.jpg"
See mythburn.log for more information.
************************************************************

Terminated

Additional information

Since Simple-Autoplay theme is selected, there is no need to generate thumbnails and thus no reason to call mytharchivehelper.

@rcrdnalor

@Jpilk
Copy link

Jpilk commented Jul 29, 2022

mythburn.py line 3282 has two 'ifs'. As a test you could try blocking the call by simply editing those conditions and rerunning.

@bshanteau
Copy link
Author

Yes, if I comment out the mytharchivehelper command, mythburn.py completes normally.

@rcrdnalor
Copy link
Contributor

I cannot reproduce this by now on current master or on fixes/32.
Can you please provide the input files (newfile2.mpg, stream.mv2) ?
Or create a short, but useless set of files with mytharchive showing the same error ( Segmentation fault ) ?

@bshanteau
Copy link
Author

bshanteau commented Aug 2, 2022

@rcrdnalor I opened the mp4 file in Avidemux to save a shorter clip and now I cannot reproduce the error using the original file. It's a mystery.

I used the current v32 mythburn.py using the mythbuntu ppa but I did have to apply your patch to mythburn.py to remove the nulls in streaminfo.xml. Is there a better way to get the newest mythburn.py?

I notice the following line in mythburn.log:
Extracting thumbnail image from /storage/mytharchive/work/1/stream.mv2 at position 10
That means extractVideoFrames is being called, right? But given that I'm not creating a DVD menu, there should be no reason to call that function.

@bshanteau
Copy link
Author

bshanteau commented Aug 2, 2022

@rcrdnalor I just installed mythtv v33 and mythburn.py creates a DVD iso file from a file just fine Thanks.

@rcrdnalor
Copy link
Contributor

Since you run mythtv master on Ubuntu, please check
if the mythtv-dbg package is installed/installable.
See
https://launchpad.net/~mythbuntu/+archive/ubuntu/33
https://www.mythtv.org/wiki/Debugging
for further information.

The ticket how-to suggests that you should post a
backtrace of the segfault you got on your system:
See
https://www.mythtv.org/wiki/Trac:TicketHowTo
Please keep the source, the reason of your segfault
for later posting on request of the MythTV developer.

In case you need further information, please search
the mailingt list
https://lists.archive.carbon60.com/mythtv/
or the forum
https://forum.mythtv.org/
for getting a proper backtrace.

In this case, please post the backtrace of

mytharchivehelper -q -q --createthumbnail --infile "/storage/mytharchive/work/1/stream.mv2" --thumblist '10' --outfile "/storage/mytharchive/work/1/title.jpg"

when runnning under gdb.

@kmdewaal
Copy link
Contributor

@bshanteau can you please check if this problem still exists after the fix of #633 has been verified?

@rcrdnalor
Copy link
Contributor

If you do not answer the above question, this issue will be closed, soon.

@rcrdnalor
Copy link
Contributor

Closing this issue as duplicate to #633.

Additionally, this issue has good ideas about improving
mythburn.py when a Simple-Autoplay theme is selected,
since there is no need for generating preview images.

Pull-Requests for improving MythTV are always welcome.
Please open a new pull request, once you propose an
improvement on that topic.

@bshanteau
Copy link
Author

bshanteau commented Nov 30, 2022

@rcrdnalor My pull request will revise a comment and add an if statement. Before I submit it, I just wanted to confirm that DVD chapter menus are used only where a main menu is also used, right?

@bshanteau
Copy link
Author

@rcrdnalor Pull request #673 created.

@bshanteau
Copy link
Author

@rcrdnalor
My pull request has this warning:

1 workflow awaiting approval
First-time contributors need a maintainer to approve running workflows.

Would you be the maintainer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants