Skip to content

Conversation

@harrynull
Copy link
Contributor

@harrynull harrynull commented Jan 13, 2018

Please prefix your pull request with one of the following: [FEATURE] [FIX] [IMPROVEMENT].

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

This will fix #807 .
FEATURE:

  • sbtl:tx3g and text:tx3g handler.
  • Support multitrack subtitles.

KNOWN ISSUES:

  • Styles & extensions of tx3g subtitles are ignored.
  • The empty default file will be created, even though sometimes(when there're multiple tracks) we don't use it.
  • -o outputfilename option is not honered. I don't think I caused it though. It seems to be broken long time ago.

NOTE:

  • I didn't test the situation when a sample has multiple atoms in it (Is it possible? I don't have a video sample to verify).
  • Although I think the timing is handled correctly, I don't have enough samples to verify.
  • All my local mp4 samples are extracted correctly, but I'd give the sample platform a go anyway.

@harrynull
Copy link
Contributor Author

harrynull commented Jan 13, 2018

The output of the sample in the issue is attached here: output.zip.

mprint("Found %d AVC track(s). ", avc_track_count);
}
else
mprint("Found no AVC track(s). ", file);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct - that "file" is not being consumed in the format string.

if (sub_type == GF_ISOM_SUBTYPE_C708) {
if (!is_ccdp) {
mprint("Your video file seems to be an interesting sample for us (%4.4s)\n", data);
mprint("We haven't met c708 subtitle not in a \'ccdp\' atom before\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't seen a c708 subtitle outside a ccdp atom before

Sounds better

{
if (is_ccdp) {
mprint("Your video file seems to be an interesting sample for us\n");
mprint("We haven't met c608 subtitle in a \'ccdp\' atom before\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above

return -1;
}

#define MEDIA_TYPE(type, subtype) (((u64)(type)<<32)+(subtype))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move close to top of file? defines in the middle of the file are likely to cause confusion (since they only start applying from the point they appear, so suddenly function position in the file becomes more important than it should be)

media = open()
for each track in media
if track is AVC track
swtich track
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch


#define MEDIA_TYPE(type, subtype) (((u64)(type)<<32)+(subtype))

void switch_output_file(struct lib_ccx_ctx *ctx, struct encoder_ctx *enc_ctx, int track_id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call the function mp4_switch_output_file()
OR move to the file that contains all the file related stuff

if((f = gf_isom_open(file, GF_ISOM_OPEN_READ, NULL)) == NULL)
{
mprint("failed to open\n");
mprint("Failed to open\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Failed to open input file (gf_isom_open() returned error)"

switch_output_file(ctx, enc_ctx, i);
}
if (process_xdvb_track(ctx, file, f, i + 1, &dec_sub) != 0) {
mprint("Error\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Error on process_xdvb_track()"

{
mprint("error\n");
if (process_avc_track(ctx, file, f, i + 1, &dec_sub) != 0) {
mprint("Error\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Error on process_avc_track()"

(unsigned char)(subtype >> 24 % 0x100), (unsigned char)((subtype >> 16) % 0x100),
(unsigned char)((subtype >> 8) % 0x100), (unsigned char)(subtype % 0x100));

mprint("", track_type);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

track_type is not being consumed by mprint()
It it's a char *, then mprint("%s", track_type)

@cfsmp3 cfsmp3 merged commit 71ac0ad into CCExtractor:master Jan 14, 2018
return data;
}

// Rrocess clcp type atom
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rrocess--> Process.

encode_sub(enc_ctx, dec_sub); // encode the previous subtitle
has_previous_sub = 0;
}
if (encode_last_only) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see in #L422 last_sub is declared but not used it?

Is this if block work in progress? Also, please fix this empty return, the function is expected to return an int and may cause build to fail.

Copy link
Contributor Author

@harrynull harrynull Feb 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saurabhshri
Sorry that I missed your comment till now.
The purpose of this if block is merely to exit the function early so that it won't attempt to process more data. (since it's the last one)
And it seems that it has already been fixed.

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

Successfully merging this pull request may close these issues.

[BUG]Can't extract multi-track subtitles from .mp4

3 participants