Opened 18 months ago

Closed 17 months ago

Last modified 17 months ago

#7188 closed defect (fixed)

webm_chunk muxer is broken since commit 18ac64235939c4c5c7656546a9545f68339affbe

Reported by: octop Owned by: cus
Priority: important Component: avformat
Version: git-master Keywords: webm regression
Cc: cus Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


The commit 18ac64235939c4c5c7656546a9545f68339affbe introduced a regression, making the webm_chunk muxer cease to function properly.

@@ -127,12 +127,12 @@ static int webm_chunk_write_header(AVFormatContext *s)
     if (ret < 0)
         return ret;
     oc = wc->avf;
-    ret = get_chunk_filename(s, 1, oc->filename);
+    ret = get_chunk_filename(s, 1, oc->url);
     if (ret < 0)
         return ret;
     if (wc->http_method)
         av_dict_set(&options, "method", wc->http_method, 0);
-    ret = s->io_open(s, &oc->pb, oc->filename, AVIO_FLAG_WRITE, &options);
+    ret = s->io_open(s, &oc->pb, oc->url, AVIO_FLAG_WRITE, &options);
     if (ret < 0)
         return ret;

In my own testing, I discovered that oc->url in that code evaluates to null, making the muxer return prematurely.

To reproduce:
ffmpeg -re -f lavfi -i sine -map 0 -strict -2 -c:a opus -f webm_chunk -header webm_live_sine.hdr webm_live_sine_%d.chk

Attachments (1)

webm-url-fix.patch (1.0 KB) - added by cus 17 months ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 18 months ago by octop

  • Keywords regression added

Changed 17 months ago by cus

comment:2 follow-up: Changed 17 months ago by cus

  • Cc cus added
  • Owner set to cus
  • Status changed from new to open

Could you try the attached patch?

comment:3 in reply to: ↑ 2 Changed 17 months ago by octop

The muxer works again after applying your patch, thank you. So the issue was caused by trying to "dynamically" create the nonexistent url field in that AVFormatContext *oc structure?

comment:4 Changed 17 months ago by cus

Yeah, the URL field (which is a replacement for the deprecated filename field) must be dynamically allocated, so it cannot be used as a static (fixed-length) buffer. I will send this patch to ffmpeg-devel and apply and backport it in a few days.

comment:5 Changed 17 months ago by cus

  • Resolution set to fixed
  • Status changed from open to closed

comment:6 Changed 17 months ago by cehoyos

  • Keywords webm added
Note: See TracTickets for help on using tickets.