h264extractor icon indicating copy to clipboard operation
h264extractor copied to clipboard

Could not play exported OPUS file

Open KDenisPi opened this issue 8 years ago • 3 comments

You have created very nice tool. However I was not able to play or convert received OPUS file I have tried to use tools from http://www.opus-codec.org/ but It do not recognize file as opus. OPUS file is attached

dump.zip

KDenisPi avatar Nov 08 '16 23:11 KDenisPi

the opus extractor will depacketize as the format | 4-bytes(length) | opus-payload | 4-bytes(length) | opus-payload,
you can get the opus element stream by discarding the 4-byte length.
Or you can change the function on_ordered_opus_payload to remove the 4 bytes length prefix.

 local function on_ordered_opus_payload(seq, opus_data)
            length = opus_data:tvb():len()
            --log("Opus packet length = "..tostring(length).."formated:"..string.format("%04x", length))         
            --writebytes(fp, length)
            fp:write(opus_data:tvb()():raw())
            fp:flush()
        end

volvet avatar Nov 09 '16 05:11 volvet

Hi guys, I'm running into the same issue. Can you elaborate how you changed the function in order to get this working?.

@KDenisPi

Many thanks,

albertollamaso avatar Apr 28 '17 14:04 albertollamaso

Hi guys, I'm running into the same issue. Can you elaborate how you changed the function in order to get this working?.

@KDenisPi

Many thanks,

I write a tool to mux the OPUS data to WebM file, which can be played. Please read the build script. You should install FFmpeg firstly. If you have any question please tell me.

https://github.com/Justme0/tywebrtc/tree/main/tools/opus_muxer

Justme0 avatar Jul 04 '24 14:07 Justme0