-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New LibAV segment ... implementation (PR 537) doesn't work #580
Comments
Reading some source code, is it possible that this line should not say
The |
One more thing that looks odd to me (but keep in mind my C++ might be a bit rusty these days). In int n = snprintf(filename, sizeof(filename), options_->output.c_str(), count_); However, this method in Output *Output::Create(VideoOptions const *options)
{
if (options->codec == "libav")
return new Output(options);
if (strncmp(options->output.c_str(), "udp://", 6) == 0 || strncmp(options->output.c_str(), "tcp://", 6) == 0)
return new NetOutput(options);
else if (options->circular)
return new CircularOutput(options);
else if (!options->output.empty())
return new FileOutput(options);
else
return new Output(options);
} Okay, I'll shut up now. I assume that somebody tested the functionality when the PR was merged, and if it worked then I'm on the wrong track looking for a general bug while I'm probably just passing the options wrong. |
Unfortunately we have also noticed a few issues with the libav segmenting changes. In fact I had to revert these changes in commit 15e9007 temporarily until we get some time to revisit and fix up these issue. |
I see, thanks for letting me know. I didn't double-check current code against the merged PR so I didn't notice... |
Yeah, sorry about the confusion. Once we get some resources free, we will work on getting this functionality back in and working correctly. |
I had to checkout 9e17265 and segmenting with libav seems to work there. On the later commits it produces a single file without interpolation of the counter into the filename. What I noticed is that implementation has an issue regarding produced .mp4 files - their timestamps are increasing per file. So for example the first file have ts 0 to 30 but the second has 30..60, third has 60..90 etc. It confuses video players like VLC and HTML video. It is good news to hear that "correct" implementation is planned. |
I was attempting to use |
I ended up using commit 07fc461 where segment functionality was not already removed for MP4 but it tooks patching the code to ensure stable split functionality with a keyframe at the start of the segment; using variable quality feature instead of just setting constant bitrate; boosting sound volume; some efforts were also put to make sound be recorded in sync without a gap increasing in time. But the hack with erasing ELST atom after MP4 segment is finished is still the key point of the solution :( Not sure if something changed last months, don't want to spend time to see that it is still broken. Update: BTW I found a solution for segmenting just video without that ELST hack, it is setting |
@koster-mobile |
I'm trying to use the
--segment
/libav feature in this PR, but it doesn't seem to do anything. I built from the repo based on these instructions, cloned today from the main branch.My complete command is as follows -- including all the options in case something makes a difference.
/usr/local/bin/libcamera-vid -n --awb auto -t 0 --exposure normal --autofocus-mode auto --tuning-file /usr/local/share/libcamera/ipa/rpi/vc4/imx708.json --width 1920 --height 1080 --codec libav --bitrate 10000000 --vflip --hflip --segment 20000 -v 2 --libav-audio --audio-bitrate 16384 --audio-device alsa_input.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00.mono-fallback -o "/mnt/video/vid-%05d.mkv"
I expected this to create a new numbered file every 20 seconds, but instead I get just one file that is literally called
vid-%05d.mkv
.Any idea what I'm doing wrong?
The text was updated successfully, but these errors were encountered: