Opened 4 weeks ago

Last modified 4 weeks ago

#6761 open defect

Allow huge filenames (datauri) in the concat demuxer

Reported by: elisnow Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: concat
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
I am trying to turn a stream of jpeg's into a video but the concat demuxer is erroring with the data uris. An output video is produced but it only has the top part of the images included with the rest of each frame being green.

(I'm actually programatically generating the concat script and feeding it into ffmpeg's stdin, but for the sake of this repro case attached is a static concat script)

How to reproduce:

ffmpeg -report -f concat -safe 0 -protocol_whitelist file,data -i concat -vf fps=30 -y out.mp4

The main error looks something like:

[mjpeg @ 00000215a6bbd9a0] overread 8

Attached is the output of the -report option.

As is obvious from the report log I am running on Windows (version 10).

Attachments (5)

ffmpeg-20171019-125351.log (25.1 KB) - added by elisnow 4 weeks ago.
report output
concat (21.8 KB) - added by elisnow 4 weeks ago.
concat script
concat_working (104 bytes) - added by elisnow 4 weeks ago.
working concat script referencing the jpeg files
img.jpg (5.6 KB) - added by elisnow 4 weeks ago.
img2.jpg (10.7 KB) - added by elisnow 4 weeks ago.

Download all attachments as: .zip

Change History (13)

Changed 4 weeks ago by elisnow

report output

Changed 4 weeks ago by elisnow

concat script

comment:1 Changed 4 weeks ago by elisnow

  • Version changed from unspecified to git-master

comment:2 Changed 4 weeks ago by cehoyos

Why do you believe there is an issue?

comment:3 follow-up: Changed 4 weeks ago by elisnow

ffmpeg outputs the overread 8 error and outputs a mostly green video. If you save the data uri jpegs to files and modify the concat script to use those jpeg files, it works properly. It is only with data uris that ffmpeg is misbehaving.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 4 weeks ago by cehoyos

Replying to elisnow:

ffmpeg outputs the overread 8 error and outputs a mostly green video.

Yes.

If you save the data uri jpegs to files and modify the concat script to use those jpeg files, it works properly.

How can I reproduce this?
When I tried to, I saw the same green images and given the many repeated characters in the base64 encoding that you provided, this did not surprise me.

It is only with data uris that ffmpeg is misbehaving.

While this is absolutely possible (and would indicate a bug) I was unable to reproduce this.

Changed 4 weeks ago by elisnow

working concat script referencing the jpeg files

Changed 4 weeks ago by elisnow

Changed 4 weeks ago by elisnow

comment:5 in reply to: ↑ 4 Changed 4 weeks ago by elisnow

Replying to cehoyos:

How can I reproduce this?
When I tried to, I saw the same green images and given the many repeated characters in the base64 encoding that you provided, this did not surprise me.

I'm confused. I have attached both images as jpeg files. These are the same images as the base64 data uris in the concat script. There is no green in either image. The first image is all white. The second image is mostly white with the header of a web page shown.

(These images are browser paints, and the resulting video should show a web page being loaded. Though for the sake of this repro I have only included the first two browser paints)

I have also attached a modified concat script which references the jpeg files and properly produces a video.

Last edited 4 weeks ago by elisnow (previous) (diff)

comment:6 Changed 4 weeks ago by cehoyos

How did you create the jpg files that you attached / how did you create the base64 encoded strings in your original command line?

comment:7 Changed 4 weeks ago by elisnow

For the attached jpg files I simply pasted the data uris into Firefox's address bar then saved the image to disk. Ordinarily what I do (to workaround this bug) is programatically save the base64 image to file and reference the saved file in the concat script which I feed into ffmpeg's stdin. If I can inject the base64 image directly into the concat script, then I don't have to take the step of first saving all the images to disk and then deleting them all later.

The source of the base64 images come from the Chrome DevTools Protocol screen casting functionality.

comment:8 Changed 4 weeks ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords concat added
  • Reproduced by developer set
  • Status changed from new to open
  • Summary changed from concat demuxer with data uri jpegs causes "overread 8" to Allow huge filenames (datauri) in the concat demuxer

There is definitely a bug because no error is shown if the filename in the concat demuxer is bigger than the allowed maximum (currently 4096), I don't know if the maintainer will accept your use-case, patch sent.

Note: See TracTickets for help on using tickets.