Skip to content

Commit

Permalink
ffmpeg presets. compare frame end to clipEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
rectalogic committed Dec 23, 2023
1 parent 221890d commit 21c2831
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
13 changes: 9 additions & 4 deletions src/mediafx/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,20 @@ int main(int argc, char* argv[])
QString command;
if (parser.isSet(qSL("command"))) {
command = parser.value(qSL("command"));
if (command == "ffplay") {
if (command == qSL("ffplay")) {
// XXX need to handle audio eventually
command = qSL("ffplay -autoexit -infbuf -f rawvideo -video_size ${MEDIAFX_FRAMESIZE} -pixel_format rgb0 -framerate ${MEDIAFX_FRAMERATE} -i pipe:${MEDIAFX_VIDEOFD}");
} else if (command == "ffmpeg") {
} else if (command.startsWith(qSL("ffmpeg:"))) {
if (!parser.isSet(qSL("output"))) {
parser.showHelp(1);
}
// XXX quicktime no longer supports qtrle
command = qSL("ffmpeg -f rawvideo -video_size ${MEDIAFX_FRAMESIZE} -pixel_format rgb0 -framerate ${MEDIAFX_FRAMERATE} -i pipe:${MEDIAFX_VIDEOFD} -f mov -vcodec rawvideo -pix_fmt uyvy422 -vtag yuvs -framerate ${MEDIAFX_FRAMERATE} -y ${MEDIAFX_OUTPUT}");
if (command == qSL("ffmpeg:lossless")) {
command = qSL("ffmpeg -f rawvideo -video_size ${MEDIAFX_FRAMESIZE} -pixel_format rgb0 -framerate ${MEDIAFX_FRAMERATE} -i pipe:${MEDIAFX_VIDEOFD} -f nut -vcodec ffv1 -flags bitexact -g 1 -level 3 -pix_fmt rgb32 -framerate ${MEDIAFX_FRAMERATE} -fflags bitexact -y ${MEDIAFX_OUTPUT}");
} else if (command == qSL("ffmpeg:mov")) {
command = qSL("ffmpeg -f rawvideo -video_size ${MEDIAFX_FRAMESIZE} -pixel_format rgb0 -framerate ${MEDIAFX_FRAMERATE} -i pipe:${MEDIAFX_VIDEOFD} -f mov -vcodec rawvideo -pix_fmt uyvy422 -vtag yuvs -framerate ${MEDIAFX_FRAMERATE} -y ${MEDIAFX_OUTPUT}");
} else {
parser.showHelp(1);
}
}
}
QString output;
Expand Down
2 changes: 1 addition & 1 deletion src/mediafx/media_clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void MediaClip::render()
if (!isActive())
return;

if (m_currentFrameTime.start() >= m_clipEnd) {
if (m_currentFrameTime.end() >= m_clipEnd) {
if (m_audioTrack)
m_audioTrack->stop();
if (m_videoTrack)
Expand Down
4 changes: 1 addition & 3 deletions tests/qmltest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ for assetspec in "$@"; do
"${BASE}/../tools/create-asset.sh" "${ASSETS}" ${assetspec} || exit 1
done

FFMPEG='ffmpeg -f rawvideo -video_size ${MEDIAFX_FRAMESIZE} -pixel_format rgb0 -framerate ${MEDIAFX_FRAMERATE} -i pipe:${MEDIAFX_VIDEOFD} -f nut -vcodec ffv1 -flags bitexact -g 1 -level 3 -pix_fmt rgb32 -framerate ${MEDIAFX_FRAMERATE} -fflags bitexact -y ${MEDIAFX_OUTPUT}'

echo Testing ${QML}
"${MEDIAFX}" --fps ${FRAMERATE} --size ${SIZE} --output "${OUTPUT}" --command "${FFMPEG}" "${QML}" || exit 1
"${MEDIAFX}" --fps ${FRAMERATE} --size ${SIZE} --output "${OUTPUT}" --command "ffmpeg:lossless" "${QML}" || exit 1
"${BASE}/../tools/framehash.sh" "${OUTPUT}" > "${OUTPUT}.framehash" || exit 1

# If framehash is different, then pixel difference each frame.
Expand Down

0 comments on commit 21c2831

Please sign in to comment.