temp_file_name(temp_dir_, "menu-%3d.mpeg", 1 + index));
std::ostringstream command_stream;
- unsigned frame_count(menu_duration_frames(frame_params_));
if (encoder_ == mpeg_encoder_ffmpeg)
{
- for (unsigned i = 0; i != frame_count; ++i)
- {
- std::string frame_name(background_name);
- frame_name.push_back('-');
- frame_name.push_back('0' + i / 10);
- frame_name.push_back('0' + i % 10);
- if (symlink(background_name.c_str(), frame_name.c_str()) != 0)
- throw std::runtime_error(
- std::string("symlink: ").append(std::strerror(errno)));
- }
command_stream <<
"ffmpeg -f image2 -vcodec png"
" -r " << frame_params_.rate_numer <<
"/" << frame_params_.rate_denom <<
- " -i " << background_name << "-%02d"
+ " -i " << background_name <<
+ " -loop_input -t " << menu_duration_seconds(frame_params_) <<
" -target " << frame_params_.common_name << "-dvd"
" -vcodec mpeg2video -aspect 4:3 -an -y /dev/stdout";
}
|| encoder_ == mpeg_encoder_mjpegtools_new);
command_stream
<< "pngtopnm " << background_name
- << " | ppmtoy4m -v0 -n" << frame_count << " -F"
- << frame_params_.rate_numer << ":" << frame_params_.rate_denom
+ << " | ppmtoy4m -v0 -n" << menu_duration_frames(frame_params_)
+ << " -F" << frame_params_.rate_numer << ":" << frame_params_.rate_denom
<< " -A" << frame_params_.pixel_ratio_width
<< ":" << frame_params_.pixel_ratio_height
<< " -Ip ";