Bug 374799 - Feature request - ability to convert video files
Summary: Feature request - ability to convert video files
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Bqm-Convert (show other bugs)
Version: 5.3.0
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-09 09:59 UTC by Roger Foss
Modified: 2017-07-28 03:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Foss 2017-01-09 09:59:17 UTC
Some of my older video files recorded with a digital camera are .MOV files containing Motion JPEGs with audio. I would like the ability for digiKam to convert these to a different format, say AVI, MP4 etc.

Preferably video file conversion should be possible with the batch tool.

One of my reason for this feature is that uploading old MOV files to Google Photos causes them to get today's timestamp. This may be caused by the lack of metadata / timestamps in the original .mov files.

I would like to see digikam be able to call FFMPEG or some other tool with appropriate parameters to convert video files.
Comment 1 caulier.gilles 2017-01-09 10:28:49 UTC
With the new QtAv dependency to handle video files in digiKam introduced with DK 5.4.0, we are able to re-encode easily video file, through ffmpeg in background.

So it's planed...

Gilles Caulier
Comment 2 caulier.gilles 2017-01-09 10:30:05 UTC
The question is : i'm not sure if BQM is the right place for a king of conversion of video file.

BQM is dedicated to process a queue a image files. It's different approach. The subject is open...

Gilles Caulier
Comment 3 Roger Foss 2017-01-11 00:24:53 UTC
Well, my take on this is if you want to convert video files, you will probably want to do it repeatedly, to batches of files. Hence, the BQM.  Also once that's implemented, I can imagine applying other base tools to videos. Ie. amp up the brightness, add some metadata, enhance contrast.  I could see the some of the same base tools apply to video.

I shall not get too far ahead: I know digikam is primarily a photo management tool.  My point is this: why NOT the BQM?
Comment 4 Andrius 2017-02-06 18:10:31 UTC
Here is the ffmpeg command I use to convert/compress video files. Works as a charm.

ffmpeg -i in.mp4 -c:v libx264 -crf 23 -c:a libfaac -q:a 100 -map_metadata 0 out.mp4

This will convert the input with the x264 encoder and FAAC audio to an output file, copying the original metadata. In order to change the quality of the output, you can:
* Change the CRF value for video. Lower means better quality. 23 is default, and anything below 18 will probably be visually lossless.
* Change the Q parameter for audio. Higher means better, and 100% is the default.

Unknown encoder 'libfaac' error? Then your ffmpeg is not compiled with FAAC support. Try " -c:a aac -strict experimental" instead.
Comment 5 Andrius 2017-02-06 18:11:21 UTC
Also, if you want to copy metadata from one video file to another you can use this command:

ffmpeg -i in.mp4 -i out.mp4 -map 1 -map_metadata 0 -c copy fixed.mp4

in.mp4 – the original file before conversion
out.mp4 – the file after Handbrake conversion
fixed.mp4 – the file with "corrected" metadata

Take two input files (in.mp4 and out.mp4), which are assigned the IDs 0 and 1, respectively.
* Map only the video/audio/subtitle streams from file 1 to the output (-map 1), so we take the bitstreams that are already converted
* Map only the metadata from file 0 to the output (-map_metadata 0)
* Use the copy codec (-c copy) to copy all the bitstreams instead of re-encoding the video.

After that, you could obviously rename fixed.mp4 to out.mp4.