vrecord icon indicating copy to clipboard operation
vrecord copied to clipboard

error muxing a packet

Open alec-bertoy opened this issue 10 months ago • 11 comments

I am trying to use vrecord on mac with a decklink studio 4k. When I end a capture, I get the error:

[out#1/matroska @ 0x7faa1e709740] Error muxing a packet

Then it gets stuck and I have to close out the terminal to stop it. Any idea what is causing this? Thanks!

alec-bertoy avatar Sep 21 '23 20:09 alec-bertoy

I am getting the same error. I'm using UltraStudio 4k with a Mac Studio (OS 13.5.2, vrecord 2023.08.07). Here is the full output. I used Crtl + C to interrupt after the error, and the rest of the processes finish.


Last login: Thu Sep 21 10:04:58 on ttys000 smpl-video2$ vrecord test Summary: FFV1 version 3/matroska yuv422p10 file from ntsc component analog. Frame MD5s=No, QCTools XML=Yes, concurrent with recording. Inputs recorded to /Volumes/Ernie/test_pm.mkv and Auxiliary Files created in /Volumes/Ernie. Hit enter to start recording

Close the playback window to stop recording. ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers built with Apple clang version 14.0.3 (clang-1403.0.22.14.1) configuration: --prefix=/opt/homebrew/Cellar/ffmpegdecklink/6.0 --disable-shared --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libfontconfig --disable-libjack --disable-indev=jack --enable-neon --enable-nonfree --enable-decklink --extra-cflags=-I/opt/homebrew/include --extra-ldflags=-L/opt/homebrew/include libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100 [decklink @ 0x1498043b0] Found Decklink mode 720 x 486 with rate 29.97(i) qcli dev build, Nov 6 2022 15:59:18 filters selected: signalstats aphasemeter astats ssim Guessed Channel Layout for Input Stream #0.0 : 7.1 Input #0, decklink, from 'UltraStudio 4K Extreme 3': Duration: N/A, start: 0.000000, bitrate: 236013 kb/s Stream #0:0: Audio: pcm_s32le, 48000 Hz, 8 channels, s32, 12288 kb/s Stream #0:1: Video: v210, yuv422p10le(bottom first), 720x486, 223725 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 0, only the last option '-c:a pcm_s24le' will be used. Stream mapping: Stream #0:0 (pcm_s32le) -> pan:default (graph 0) Stream #0:1 (v210) -> setdar:default (graph 0) setdar:default (graph 0) -> Stream #0:0 (ffv1) pan:default (graph 0) -> Stream #0:1 (pcm_s24le) Stream #0:0 -> #1:0 (pcm_s32le (native) -> pcm_s24le (native)) Stream #0:1 -> #1:1 (copy) Output #1, matroska, to 'pipe:': Metadata: encoder : Lavf60.3.100 Stream #1:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 7.1, s32, 9216 kb/s Metadata: encoder : Lavc60.3.100 pcm_s24le Stream #1:1: Video: v210 (v210 / 0x30313276), yuv422p10le(bottom first), 720x486, q=2-31, 223725 kb/s, 29.97 fps, 29.97 tbr, 1k tbn Input #0, matroska,webm, from 'fd:': Metadata: ENCODER : Lavf60.3.100 Duration: N/A, start: 0.000000, bitrate: 9216 kb/s Stream #0:0: Audio: pcm_s24le, 48000 Hz, 8 channels, s32 (24 bit), 9216 kb/s Metadata: ENCODER : Lavc60.3.100 pcm_s24le Stream #0:1: Video: v210 (v210 / 0x30313276), yuv422p10le(bottom first), 720x486, 29.97 fps, 29.97 tbr, 1k tbn

analyzing input file... - 0 of 100 %[Parsed_pan_1 @ 0x600003ff04d0] Pure channel mapping detected: 0 1 [ffv1 @ 0x1499055d0] bits_per_raw_sample > 8, forcing range coder Output #0, matroska, to '/Volumes/Ernie/test_pm.mkv': Metadata: creation_time : now encoder : Lavf60.3.100 Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p10le(tv, smpte170m/smpte170m/bt709, bottom coded first (swapped)), 720x486 [SAR 9:10 DAR 4:3], q=2-31, 200 kb/s, 29.97 fps, 1k tbn Metadata: encoder : FFV1 version 3 Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 2304 kb/s Metadata: encoder : Lavc60.3.100 pcm_s24le .................................................. 100 of 100 %/0 49 A-V: 0.053 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
analyzing completed

generating QCTools report... .................................................. 100 of 100 % adding thumbnails to QCTools report... .................................................. 100 of 100 % adding panels to QCTools report... .................................................. 100 of 100 % generating QCTools report... done, in /Volumes/Ernie/test_pm.mkv.qctools.mkv av_interleaved_write_frame(): Broken pipe [out#1/matroska @ 0x600003df8300] Error muxing a packet ^C mv: /Volumes/Ernie/test_pm_vrecord_input.log: set owner/group (was: 503/0): Operation not permitted Vrecord is analyzing your video file. Please be patient. Vrecord is generating graphs from the QCTools data. One moment please. QCTools analysis is complete. cat: /Volumes/Ernie/test_pm_ffmpeg_input.log: No such file or directory cat: /Volumes/Ernie/test_pm_ffmpeg_input.log: No such file or directory Checking file conformance against FFV1 video policy... 2023-09-21T13:33:47 - File passed policy check for FFV1 video. Vrecord is attaching logs to your Matroska file: The file is being analyzed. The changes are written to the file. Done. The file is being analyzed. The changes are written to the file. Done. Vrecord is done attaching logs to your Matroska file! smpl-video2$

michaelangeletti avatar Sep 21 '23 20:09 michaelangeletti

@michaelangeletti or @alec-bertoy, does the error occur if you turn off the option to create qctools xml?

privatezero avatar Sep 21 '23 21:09 privatezero

@privatezero , yes it still occurs for me. I just tested without the qctools xml output and I still get the error.

michaelangeletti avatar Sep 21 '23 21:09 michaelangeletti

@privatezero I also still get the error when I turn of the qctools option

alec-bertoy avatar Sep 22 '23 13:09 alec-bertoy

Thanks for confirming - I haven't yet been able to reproduce on my end, but this feels like a part of the capture pipe might be getting held up somehow. I'm assuming that you both are using the escape key to close the monitoring window and end the capture?

What happens if instead of ending the capture that way, you kill it via control-C in the terminal? (The same way that @michaelangeletti did to unfreeze it)

privatezero avatar Sep 25 '23 20:09 privatezero

@privatezero , I tested this afternoon, and when I turn off the option to create qctools xml and use control-C, I don't get the error. Thank you for identifying this workaround! I will generate qctools data after the digitization process is complete.

michaelangeletti avatar Sep 25 '23 23:09 michaelangeletti

@privatezero @michaelangeletti Stopping the capture with control-C works for me as well even if I keep the option to create qctools xml. Thanks for the help!

alec-bertoy avatar Sep 28 '23 19:09 alec-bertoy

Thanks for reporting! Hopefully we'll ultimately be able to figure out the underlying cause for that to hang up on some systems!

privatezero avatar Sep 28 '23 20:09 privatezero

Hi, you are all probably using FFmpeg v6.X, right?

Since version 6.0, FFmpeg moved to fully threaded architecture. That means when you quit MPV while done recording, it breaks the pipe output running in one thread, but that won't make the parent process exit, therefore the thread writing frames into file will stay running until you press ^C..

I would suggest to change the logic to use tee output, which will make also other threads exit gracefully when one of them is broken (you can change that via "onfail" parameter).

Or we can set the FFmpeg version requirement to be <v6.0 but I wouldn't recommend this :)

I have sucessfully tested that this doesn't happen with version 5.1.3, so the override is to use <6.0 for the time being.

jonassvatos avatar Oct 24 '23 16:10 jonassvatos

Just confirming I too have this issue (Mac OS Sonoma on M1) CTRL-C (Not CMD-C as I am so used to assuming now) does resolve it. Thanks.

marshalleq avatar Oct 28 '23 03:10 marshalleq

Hi @alec-bertoy and @lsde and @marshalleq and @michaelangeletti , please run brew upgrade. This should downgrade ffmpegdecklink from 6.0 to 5.1.2 which should fix the error.

dericed avatar Nov 03 '23 22:11 dericed