Opened 14 years ago
Closed 14 years ago
Last modified 14 years ago
#9036 closed patch (Fixed)
Fix for bug on flowplayer script
Reported by: | Owned by: | beirdo | |
---|---|---|---|
Priority: | minor | Milestone: | 0.24.1 |
Component: | Plugin - MythWeb | Version: | Master Head |
Severity: | medium | Keywords: | flash flv flowplayer streaming |
Cc: | Ticket locked: | no |
Description
The file stream_flv.pl in mythweb/modules/stream is responsible for on the fly transcoding to flv format, when using the flowplayer in MythWeb For some reason ffmpeg is only able to transcode to a size with even height and width. When calculating the screen size of the file to stream based on the size of the existing recording, the script attempts to use the function round_even in Math::Round to round to an even number. Unfortunately this function only rounds to an even number when rounding a decimal number, but in some cases, the value passed to round_even is an odd number without decimals. This causes ffmpeg to be launched with an odd target size, and ultimately fail.
The 3 calls to round_even in the script need to be replaced with calls to nearest_floor(2, Which is part of the same Math::Round package. This will make sure to spit out only even integers and nothing else.
Attached is the modified script file. Please include this fix into the source code.
Attachments (2)
Change History (17)
Changed 14 years ago by
Attachment: | stream_flv.pl added |
---|
comment:1 Changed 14 years ago by
Status: | new → infoneeded_new |
---|
Please attach a unified diff (diff -u or svn diff) rather than a raw file.
comment:2 Changed 14 years ago by
Milestone: | unknown → 0.24 |
---|---|
Status: | infoneeded_new → assigned |
Version: | Unspecified → Trunk Head |
comment:3 Changed 14 years ago by
Resolution: | → Duplicate |
---|---|
Status: | assigned → closed |
comment:4 Changed 14 years ago by
The query is still wrong (at least for my system) in the stream_flv.pl script.
It gets the width/height using this query: $sh = $dbh->prepare('SELECT data FROM recordedmarkup WHERE chanid=? AND starttime=FROM_UNIXTIME(?) AND data IS NOT NULL ORDER BY data DESC');
In my database, there is another datum added that might be the number of frames (type = 32) and is usually in the tens of thousands. So the width is set to 29000 and then the aspect ratio is calculated incorrectly.
Changing the query to this: $sh = $dbh->prepare('SELECT data FROM recordedmarkup WHERE chanid=? AND starttime=FROM_UNIXTIME(?) AND data IS NOT NULL ORDER BY type');
sorts type = 30 first (this contains width in my DB), 31 second (this contains height) and then 32 (whatever the absurdly large number is).
I don't have the setup to provide a patch, but this is the only ref I found when googling the problem (squished video in mythweb streaming), so I figured I would post it here in case anyone was paying attention.
comment:5 Changed 14 years ago by
Resolution: | Duplicate |
---|---|
Status: | closed → new |
comment:6 Changed 14 years ago by
Owner: | changed from Rob Smith to beirdo |
---|---|
Status: | new → accepted |
comment:7 Changed 14 years ago by
I will take a look at this revised bug. The query shown does seem absurd to me, shouldn't be hard to fix.
comment:8 Changed 14 years ago by
I've been using this query to ignore the other type:
$dbh->prepare('SELECT data FROM recordedmarkup WHERE chanid=? AND starttime=FROM_UNIXTIME(?) AND mark<10 AND (TYPE=30 OR TYPE=31) AND data IS NOT NULL ORDER BY data DESC');
This grabs the initial size (I had an issue where the size would change on ads).
comment:9 Changed 14 years ago by
Resolution: | → Fixed |
---|---|
Status: | accepted → closed |
comment:10 Changed 14 years ago by
comment:11 Changed 14 years ago by
This patch works properly when the video records cleanly, but when I get digital artifacts on my DTA, the analog recording has many entries for types 30 and 31. Here is a search on one such program:
chanid | starttime | mark | type | data |
---|---|---|---|---|
2041 | 2010-11-10 22:59:00 | 0 | 30 | 720 |
2041 | 2010-11-10 22:59:00 | 34461 | 30 | 2796 |
2041 | 2010-11-10 22:59:00 | 34464 | 30 | 720 |
2041 | 2010-11-10 22:59:00 | 36156 | 30 | 4094 |
2041 | 2010-11-10 22:59:00 | 36160 | 30 | 720 |
2041 | 2010-11-10 22:59:00 | 64478 | 30 | 6 |
2041 | 2010-11-10 22:59:00 | 64480 | 30 | 720 |
2041 | 2010-11-10 22:59:00 | 76205 | 30 | 3748 |
2041 | 2010-11-10 22:59:00 | 76210 | 30 | 720 |
2041 | 2010-11-10 22:59:00 | 0 | 31 | 480 |
2041 | 2010-11-10 22:59:00 | 34461 | 31 | 3840 |
2041 | 2010-11-10 22:59:00 | 34464 | 31 | 480 |
2041 | 2010-11-10 22:59:00 | 36156 | 31 | 98 |
2041 | 2010-11-10 22:59:00 | 36160 | 31 | 480 |
2041 | 2010-11-10 22:59:00 | 64478 | 31 | 3922 |
2041 | 2010-11-10 22:59:00 | 64480 | 31 | 480 |
2041 | 2010-11-10 22:59:00 | 76205 | 31 | 3568 |
2041 | 2010-11-10 22:59:00 | 76210 | 31 | 480 |
2041 | 2010-11-10 22:59:00 | 0 | 32 | 29970 |
Since this patch just takes the first two entries for the width and height, the aspect ratio is horribly off in Flowplayer (720x2796 scaled down).
Just adding in 'AND mark=0' in the query fixes this on my system.
comment:12 Changed 14 years ago by
Resolution: | Fixed |
---|---|
Status: | closed → new |
comment:13 Changed 14 years ago by
Milestone: | 0.24 → 0.24.1 |
---|---|
Status: | new → assigned |
comment:14 Changed 14 years ago by
Resolution: | → Fixed |
---|---|
Status: | assigned → closed |
Patched files