-
Notifications
You must be signed in to change notification settings - Fork 539
[FEATURE] Support mp4 tx3g & multitrack subtitles #898
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
Conversation
|
The output of the sample in the issue is attached here: output.zip. |
src/gpacmp4/mp4.c
Outdated
| mprint("Found %d AVC track(s). ", avc_track_count); | ||
| } | ||
| else | ||
| mprint("Found no AVC track(s). ", file); |
There was a problem hiding this comment.
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.
src/gpacmp4/mp4.c
Outdated
| 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"); |
There was a problem hiding this comment.
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
src/gpacmp4/mp4.c
Outdated
| { | ||
| 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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to above
src/gpacmp4/mp4.c
Outdated
| return -1; | ||
| } | ||
|
|
||
| #define MEDIA_TYPE(type, subtype) (((u64)(type)<<32)+(subtype)) |
There was a problem hiding this comment.
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)
src/gpacmp4/mp4.c
Outdated
| media = open() | ||
| for each track in media | ||
| if track is AVC track | ||
| swtich track |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch
src/gpacmp4/mp4.c
Outdated
|
|
||
| #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) { |
There was a problem hiding this comment.
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
src/gpacmp4/mp4.c
Outdated
| if((f = gf_isom_open(file, GF_ISOM_OPEN_READ, NULL)) == NULL) | ||
| { | ||
| mprint("failed to open\n"); | ||
| mprint("Failed to open\n"); |
There was a problem hiding this comment.
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)"
src/gpacmp4/mp4.c
Outdated
| switch_output_file(ctx, enc_ctx, i); | ||
| } | ||
| if (process_xdvb_track(ctx, file, f, i + 1, &dec_sub) != 0) { | ||
| mprint("Error\n"); |
There was a problem hiding this comment.
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()"
src/gpacmp4/mp4.c
Outdated
| { | ||
| mprint("error\n"); | ||
| if (process_avc_track(ctx, file, f, i + 1, &dec_sub) != 0) { | ||
| mprint("Error\n"); |
There was a problem hiding this comment.
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()"
src/gpacmp4/mp4.c
Outdated
| (unsigned char)(subtype >> 24 % 0x100), (unsigned char)((subtype >> 16) % 0x100), | ||
| (unsigned char)((subtype >> 8) % 0x100), (unsigned char)(subtype % 0x100)); | ||
|
|
||
| mprint("", track_type); |
There was a problem hiding this comment.
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)
| return data; | ||
| } | ||
|
|
||
| // Rrocess clcp type atom |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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):
My familiarity with the project is as follows (check one):
This will fix #807 .
FEATURE:
KNOWN ISSUES:
-o outputfilenameoption is not honered. I don't think I caused it though. It seems to be broken long time ago.NOTE: