After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 583189 - [mp4mux] add PSP hack mode which overrides the real height and width
[mp4mux] add PSP hack mode which overrides the real height and width
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other Linux
: Normal enhancement
: git master
Assigned To: Thiago Sousa Santos
GStreamer Maintainers
: 595288 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-05-19 10:19 UTC by Christian Fredrik Kalager Schaller
Modified: 2011-05-27 08:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial patch (20.47 KB, patch)
2009-10-19 17:55 UTC, Thiago Sousa Santos
none Details | Review
mp4 for PSP with videotestsrc signal (894.39 KB, application/octet-stream)
2009-10-20 19:53 UTC, Thiago Sousa Santos
  Details
Another try with the obligatory fields (894.41 KB, application/octet-stream)
2009-10-22 23:34 UTC, Thiago Sousa Santos
  Details

Description Christian Fredrik Kalager Schaller 2009-05-19 10:19:51 UTC
Sony decided to hamper people in putting movies in memory cards on the PSP by hardcoding 340x240 as the maximum resolution in their demuxer, even if their screen and CPU handles much more. So what most people do today is that they get the MP4 file to lie about the size of the video inside and everything is fine.

So I need a property on the mp4 muxer that lets me specificy a wrong size in the muxer structure to pretend the included video stream is smaller than it is.
Comment 1 Mark Nauwelaerts 2009-05-19 10:42:26 UTC
If I read it right, you basically need to modify the width and height of the incoming caps (which will then recorded by the muxer).  Such caps modifying seems to be more a generic pipeline functionality rather than something that might go in a (or for that matter each individual) muxer.  For example, gentrans has a capssetter element that can do just that.
Comment 2 Tim-Philipp Müller 2009-05-20 00:45:39 UTC
Thanks Sony!
Comment 3 Christian Fredrik Kalager Schaller 2009-05-20 11:55:00 UTC
I will test with capssetter ASAP, if that does what I need maybe its better to just move that to -bad (and eventually good) and not need this hacks mode to the muxer at all.
Comment 4 Mark Nauwelaerts 2009-06-25 16:18:33 UTC
Note that capssetter has now arrived in -bad, so what about this?
Comment 5 Christian Fredrik Kalager Schaller 2009-06-25 16:23:06 UTC
I guess it should be closed :) Closing as Fixed
Comment 6 Tim-Philipp Müller 2009-06-25 20:04:00 UTC
I'm re-opening this to discuss what the best solution in this particular case might be and if work is still needed on mp4mux.

I think adding some kind of "enable-psp-hack" or "target-device" property (I'm sure someone can find a better name) on the muxer would be a better solution, because:

 a) it's discoverable in gst-inspect-0.10, which
    lowers the barriers of entry/making-stuff-work
    for newcomers

 b) can be used in connection with GstPreset

 c) means that it would still be possible to use
    the width/height of the input caps for
    accepting/rejecting input video streams (in
    future one might not want to accept resolutions
    that are too high for that device to handle,
    for example)

 d) it's closer to the Right Thing To Do, because
    it doesn't violate the usual requirement that
    buffer/stream data is correctly described
    by the caps set on them
Comment 7 Wim Taymans 2009-06-25 20:11:40 UTC
I agree with Tim for all the reasons he stated plus it's also more scalable, what if some new hack needs to be done that cannot be done with some element before it (like make sure the order of atoms is this and that).
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2009-07-22 09:25:36 UTC
Should it be a GFlag format-hacks=psp-resolution|xxx-quicks|... then (assuming that we won't run out of flags :)) ?
Comment 9 Bastien Nocera 2009-09-15 15:50:40 UTC
It's not limited to 320x240. You can do 368x208 with it.

The limit seems to be 76800 pixels in all (not 64k as mentioned on the mencoder page):
http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-handheld-psp.html

I don't think that adding this hack is necessary per se, especially when we still can't create a container with the ftypMSNV required.
Comment 10 Christian Fredrik Kalager Schaller 2009-09-15 15:52:56 UTC
Yeah, well there is the capssetter element in bad now which lets us do this (and set the ftyp) so if we are to do this we can just use that. Closing this bug.
Comment 11 Mark Nauwelaerts 2009-09-15 16:34:54 UTC
Although capssetter can influence width/height (whether or not that is the way to go), I do not see how it could do so for the ftyp ?
Comment 12 Tim-Philipp Müller 2009-09-15 17:01:53 UTC
> Yeah, well there is the capssetter element in bad now which lets us do this
> (and set the ftyp) so if we are to do this we can just use that. Closing this
> bug.

Has anything changed since this was re-opened the last time? See comments 6 and 7.
Comment 13 Bastien Nocera 2009-09-15 17:07:48 UTC
FYI, I opened bug 595288 about the necessary hacks to have video muxing working for the PSP.
Comment 14 Thiago Sousa Santos 2009-10-16 23:22:12 UTC
I'm trying to write a patch using the 'target-device' property and I just noticed that the caps that should be handled by mp4mux when the target is psp is really smaller than the default ones. Just wanted to point it out here so we don't forget about it.
Comment 15 Thiago Sousa Santos 2009-10-19 10:24:57 UTC
IEC 100/1384 ( http://www.canieti.com.mx/assets/files/1011/IEC_100_1384_DC.pdf ) defines a mp4 variant that probably is what PSP uses.
Comment 16 Thiago Sousa Santos 2009-10-19 17:55:51 UTC
Created attachment 145799 [details] [review]
Initial patch

Initial patch using target-device alternative and doing only the obligatory as from the spec.

Probably patch will only apply after patches from https://bugzilla.gnome.org/show_bug.cgi?id=584361

How can we test this? Anyone with a PSP around?
Comment 17 Bastien Nocera 2009-10-20 12:01:49 UTC
It would be faster for me to test if you generated a test file that I can dump onto the PSP...
Comment 18 Thiago Sousa Santos 2009-10-20 19:53:07 UTC
Created attachment 145889 [details]
mp4 for PSP with videotestsrc signal
Comment 19 Bastien Nocera 2009-10-21 11:44:17 UTC
(In reply to comment #18)
> Created an attachment (id=145889) [details]
> mp4 for PSP with videotestsrc signal

Shows up as "Unsupported data".

The video bitrate isn't set in the information screen.
Comment 20 Thiago Sousa Santos 2009-10-22 23:34:08 UTC
Created attachment 146072 [details]
Another try with the obligatory fields

Ok, fixed a bug in the PROF atom and added bitrates to them. If this still doesn't work I'll add all the fields, even the optional ones.
Comment 21 Thiago Sousa Santos 2010-02-02 15:17:25 UTC
*** Bug 595288 has been marked as a duplicate of this bug. ***
Comment 22 Thiago Sousa Santos 2010-02-02 15:20:25 UTC
anyone with a PSP feels like testing?
Comment 23 Christian Fredrik Kalager Schaller 2010-02-02 15:24:03 UTC
I will try to do so this week.
Comment 24 Bastien Nocera 2010-02-02 16:31:07 UTC
The video bitrate still isn't detected, the resolution shows up as 320x240, and the video codec as AVC.
Comment 25 Thiago Sousa Santos 2010-10-04 12:15:12 UTC
I borrowed a PSP from a friend to do some testings on this and here are my current findings.

If you use a lower enough resolution (340 x 240 as Christian suggested) you don't need any hacks, mp4mux as is works fine.

I also tried simply lying about the dimensions on the tkhd and stsd entry atoms won't make it work, the psp reports something like 'unsupported data'.

I'll try adding the extra atoms from #595288 and testing later today.
Comment 26 Thiago Sousa Santos 2010-10-04 21:59:20 UTC
Has someone got this working by just lying in the video dimensions? I can't.

I guess it is saner to add a 'target-device' property and restrict the get_caps to what is really supported. Or should this be handled at a 'profile' level?

Does someone have a video with a higher resolution that works on the PSP?
Comment 27 Bastien Nocera 2010-11-23 18:18:42 UTC
(In reply to comment #26)
> Has someone got this working by just lying in the video dimensions? I can't.

I never could either.
Comment 28 Vladimir 2010-12-29 13:30:11 UTC
http://www.ffmpeg.org/faq.html#SEC22
"higher resolution for newer PSP firmwares, width<=480, height<=272"
Depends on the firmware version
Comment 29 Christian Fredrik Kalager Schaller 2011-05-26 11:27:46 UTC
Based on Vladimirs comment I will close this bug as obsolete.
Comment 30 Tim-Philipp Müller 2011-05-26 11:57:38 UTC
> Based on Vladimirs comment I will close this bug as obsolete.

Please explain? As I understand it you still need to fake a smaller resolution in the container somehow, no?
Comment 31 Christian Fredrik Kalager Schaller 2011-05-27 08:52:41 UTC
Well it is a hack to begin with and it seems to be a version dependent hack at best, and nobody managed to get this working. So I am not sure keeping this bug open is worth it, as it is not even a bug, it is a feature request to allow for the creation of broken files to support a few PSP systems.