-
-
Notifications
You must be signed in to change notification settings - Fork 796
FFmprobe read large comments from mp4 file is truncated #331
Comments
Can you please provide some data about this issue, like a sample file that has large comments, full command you're using on FFprobe, also maybe console output? |
Hi, @tanersener I may not be able to upload the content due to copyright issues. However, what I do know is that all the truncated comment text have the same size e.g : Which already gives quite a bit of useful information. The videos were successfully encoded with the actual text size i.e: So then, does |
Can you share There are some internal limits inside I don't define limits about |
Made some tests on desktop |
Hi, @tanersener using desktop However, when I just use
What is used in the library, is the source of this cut-off. It uses:
Could |
It is worth noting that, the section |
Why don't you execute |
Awesome! Resorted to using FFprobe.execute("-v quiet -print_format json -show_format --hide_banner -i 7worlds.mp4") which gives me JSON I can serialize and neatly get the data that I needed. This is more than I needed and works like a charm. Thank you for the insight. |
The above does give more text, but it is still cut off after 1024 characters. Would be great to have a way to guarantee we get the full text. If you know of a flag to pass that will do that please let me know. |
If you do not get a proper solution, you will be forced to fetch the comments alone using a second execution, which effectively slows down your program. val command = arrayOf(
"-v", "error",
"-hide_banner",
"-pretty",
"-show_error",
"-show_entries",
"format_tags=comment",
"-of", "default=noprint_wrappers=1:nokey=1",
"-i", realPath
) |
I was hopeful that the above would give the full comment, but it cuts it off at exactly 1000 characters, not quite as good as the 1024 I was getting. Is there anything else I could try? |
My best bet is that there is a limit on the data size that the metadata can carry, and this is in FFmpeg. Best place to get help on that would be to join the mailing list and ask the question there. I am sure you'll get a response in a day. |
I found a ticket in ffmpeg which describes this issue, where the limit is defined, and how to increase it. There is also a zip file attached to the ticket with a sample audio file that demonstrates the issue (I didn't look at it myself). What do you think @tanersener? Would you be willing to increase the character limit per line for the output? It is quite annoying to have them often cut off. It seems like it would be a small change as it looks like it would just be increasing the allowed length printing the output for each line in /src/ffmpeg/libavformat/ffmetadec.c. I believe it is the read_line_to_bprint_escaped tmp[1024] (line 40) that is enforcing this limit. Could you bump that up in your releases to something less likely to concat the tags output? Maybe 10x that amount? I think others would also benefit from this change. |
@jaredbracken I prefer to solve this kind of issues without modifying |
I am using his solution which does work to increase the limit from 255 to 1024. That worked for @RowlandOti because while his output was greater than 255 it was less than 1024. Any tag which character greater than 1024 will be truncated. Would logs and a sample file still be helpful to you? |
Yes, I need to see it locally to before making any changes. |
Ok, I am attaching a small audio sample file where I created a lorem ipsum comment tag that is longer than 1k characters. I am executing FFprobe with the following arguments. The comment tag output looks like this: This also is a problem I have to manually fix before parsing the json because an exception will happen trying to parse due to the missing close quote. |
Thanks. Made some tests with your file. I think there is a problem about parsing, I'm still trying to analyse it. But using at the following code I can see that the full comment is there.
|
Is that code for iOS? You are saying it works on iOS, but not Android? I tried with the same parameters you listed, on Android, and am still getting it cut off. I hope it's something that can be fixed without much difficulty. Thank you very much for taking time to look into this. |
@jaredbracken Made some tests on |
Closing issue, waiting on a release. |
Description
FFprobe.getMediaInformation()
read comments from mp3 file is truncated, when the text is long. I am not sure, but more than a certain number, it gets truncated at that point whenever, we read using FFmprobeExpected behavior
Full text encoded in the comments section needs to be returned - even if large
Current behavior
Text from the comments section is truncated
Encoded Text in comment section
At a predominantly white Ivy League college, a group of black students navigate various forms of racial and other types of discrimination. | Buoyed by his front-page story on the blackface party, shy reporter Lionel begins to come out of his shell and embrace his true identity. | A college radio host named Samantha leads the outcry over an offensive party on campus; a revelation about Samantha's love life puts her in an awkward spot.
Actual Result
At a predominantly white Ivy League college, a group of black students navigate various forms of racial and other types of discrimination. | In the second season of this comedy series, Sam (Logan Browning) finds herself at the epicentre of social media ba
Environment
Platform: [e.g. Android/IOS]
Architecture: [arm-v7a, arm-v7a-neon, arm64-v8a, x86, x86_64, armv7, armv7s, arm64, i386, x86_64]
Version 4.3
Android Studio version 3.5
The text was updated successfully, but these errors were encountered: