Discussion:
AVCHD Camcorder SD cards
Christopher Hoskin
2016-04-01 21:48:10 UTC
Permalink
Hello,

I am interested in detecting when an SD card used in a camcorder is
connected to a computer. There appears to be a convention (possibly a
standard, but I don't have a reference?) that camcorders recording to the
AVCHD format structure their file layout as shown here:

Loading Image...

Currently this results in a Camcorder SD card being identified as
'x-content/image-dcf', which typically leads to the desktop environment
automatically opening a photo editing application, rather than a video
editing application.

As a first draft, the entry might look something like this:

<mime-type type="x-content/camcorder-avchd">
<_comment>AVCHD Camcorder SD Card</_comment>
<treemagic>
<treematch path="PRIVATE/AVCHD/BDMV/STREAM" type="directory"
non-empty="true"/>
</treemagic>
</mime-type>

I am not an expert in this area, so this may need some refinement.

I would be interested to know your thoughts on whether it would be
appropriate to introduce such a MIME type?

Thanks for your time.

Christopher Hoskin
Stefan Blachmann
2016-04-01 22:59:10 UTC
Permalink
Hi Christopher,

the desktop managers or whatever are free to choose from the
applications that offer a particular mimetype. There is no
"standardized" OpenWith mechanism.
Thus it's quite random what app(s) from the available ones get opened.

This is a shortcoming of the standard. I don't see a way to escape it
except of generally offering an OpenWith dialog.

Hope this helps.
Stefan
Post by Christopher Hoskin
Hello,
I am interested in detecting when an SD card used in a camcorder is
connected to a computer. There appears to be a convention (possibly a
standard, but I don't have a reference?) that camcorders recording to the
https://en.wikipedia.org/wiki/File:AVCHD_actual_file_structure.jpg
Currently this results in a Camcorder SD card being identified as
'x-content/image-dcf', which typically leads to the desktop environment
automatically opening a photo editing application, rather than a video
editing application.
<mime-type type="x-content/camcorder-avchd">
<_comment>AVCHD Camcorder SD Card</_comment>
<treemagic>
<treematch path="PRIVATE/AVCHD/BDMV/STREAM" type="directory"
non-empty="true"/>
</treemagic>
</mime-type>
I am not an expert in this area, so this may need some refinement.
I would be interested to know your thoughts on whether it would be
appropriate to introduce such a MIME type?
Thanks for your time.
Christopher Hoskin
Christopher Hoskin
2016-04-02 07:23:21 UTC
Permalink
Dear Stefan,

Thanks for your reply. I think I didn't explain my question very well.

If x-content/audio-dvd, x-content/video-bluray, x-content/video-hddvd etc.
are valid MIME types, detected by the presence of certain files or
directory structures, should there also be a MIME type for AVCHD, indicated
by the presence of a path PRIVATE/AVCHD/BDMV/STREAM?

But perhaps there is a good reason why this is not the case?

Thanks.

Christopher
Post by Stefan Blachmann
Hi Christopher,
the desktop managers or whatever are free to choose from the
applications that offer a particular mimetype. There is no
"standardized" OpenWith mechanism.
Thus it's quite random what app(s) from the available ones get opened.
This is a shortcoming of the standard. I don't see a way to escape it
except of generally offering an OpenWith dialog.
Hope this helps.
Stefan
Post by Christopher Hoskin
Hello,
I am interested in detecting when an SD card used in a camcorder is
connected to a computer. There appears to be a convention (possibly a
standard, but I don't have a reference?) that camcorders recording to the
https://en.wikipedia.org/wiki/File:AVCHD_actual_file_structure.jpg
Currently this results in a Camcorder SD card being identified as
'x-content/image-dcf', which typically leads to the desktop environment
automatically opening a photo editing application, rather than a video
editing application.
<mime-type type="x-content/camcorder-avchd">
<_comment>AVCHD Camcorder SD Card</_comment>
<treemagic>
<treematch path="PRIVATE/AVCHD/BDMV/STREAM" type="directory"
non-empty="true"/>
</treemagic>
</mime-type>
I am not an expert in this area, so this may need some refinement.
I would be interested to know your thoughts on whether it would be
appropriate to introduce such a MIME type?
Thanks for your time.
Christopher Hoskin
Bastien Nocera
2016-04-15 09:43:28 UTC
Permalink
Post by Christopher Hoskin
Hello,
I am interested in detecting when an SD card used in a camcorder is
connected to a computer. There appears to be a convention (possibly a
standard, but I don't have a reference?) that camcorders recording to
https://en.wikipedia.org/wiki/File:AVCHD_actual_file_structure.jpg
Currently this results in a Camcorder SD card being identified as 'x-
content/image-dcf', which typically leads to the desktop environment
automatically opening a photo editing application, rather than a
video editing application.
  <mime-type type="x-content/camcorder-avchd">
    <_comment>AVCHD Camcorder SD Card</_comment>
    <treemagic>
      <treematch path="PRIVATE/AVCHD/BDMV/STREAM" type="directory"
non-empty="true"/>
    </treemagic>
  </mime-type>
I am not an expert in this area, so this may need some refinement.
I would be interested to know your thoughts on whether it would be
appropriate to introduce such a MIME type?
Mime-types should be added to shared-mime-info. See the HACKING file on
how to submit new mime-types.

However, the main problem is what do you expect to open this mime-type?
What application, if passed the path to the SD card, will recognise
that it's from a camcorder and offer a different behaviour?

I guess the problem is that it's wrongly detected as a camera, though
it's hard to know why based on the information you provided. Whether or
not you add a mime-type for AVCHD camcorders, it will still be detected
as a camera.

Cheers

Loading...