0

I want to have the output file to have same name from source ( for eg first filename from list.txt), how can I do it?

This is the code I have which converts the all the .avi in folder to a single files and renames it to output.avi.

Instead of output.avi I want the filename to be same as first filename from source folder or first filename from list.txt.

for %%f in (*.avi) do (
    echo file %%f >> list.txt
)
ffmpeg -f concat -safe 0 -i list.txt -c copy output.avi
del list.txt

One more thing I want to know, is it possible to flip video horizontal or mirror it without re-encoding?

1
  • You should only ask one question per post. Multi question posts tend to get ignored or get partial answers which often don't get accepted. Commented May 21, 2019 at 17:20

2 Answers 2

1

I don't think ffmpeg supports "backreferencing" the input filenames. I suggest handling that in bash or some through other means of scripting. E.g. you can use the first line of list.txt as the output filename like this (untested):

ffmpeg -f concat -i list.txt -c copy output/$(head -1 list.txt)

In this example if the first line is foo.avi, the output will be saved at output/foo.avi.

is it possible to flip video horizontal or mirror it without re-encoding

Apparently you can set rotation metadata without re-encoding to hint video players to play it back with the given rotation. Maybe there are metadata flags for mirroring or flipping, but I couldn't find any.

If this does not work for you, I don't believe there is a built-in solution to do this without re-encoding.

Sign up to request clarification or add additional context in comments.

Comments

1

Is it possible to flip video horizontal or mirror it without re-encoding?

No, not when using filters (such as hflip, vflip, rotate, etc). Filtering requires re-encoding.

Rotation metadata as mentioned in another answer may suffice this use case, but support among players is not universal. There is no metadata for mirroring or flipping: only rotation.

If that is not acceptable then the player itself may have mirroring/flipping capabilities. Example:

mpv -vf hflip video.mp4

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.