thimc / vifmimg

Image previews for Vifm (vi file manager) using Überzug
GNU General Public License v3.0
242 stars 26 forks source link

Combine video preview with text-based mediainfo #10

Closed maxigaz closed 3 years ago

maxigaz commented 4 years ago

Is it possible to display a text-based preview like the output of mediainfo under a video preview?

I’ve tried editing vifmrc the following way, but it makes vifm hang.

fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
        \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
        \ vifmimg videopreview %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear; mediainfo

If I replace what’s after the list of extensions with \ echo "test"; mediainfo, the output of both commands appear as expected, so I wonder if I’m using an incorrect syntax or it’s a limitation.

thimc commented 3 years ago

Hi,

You should be able to do this by following the example below.

        "video")
            [ ! -f "$CACHE" ] && \
                ffmpegthumbnailer -i "$6" -o "${CACHE}.jpg" -s 0 -q 5
            image "$1" "$2" "$3" "$4" "$5" "${CACHE}.jpg"
            mediainfo $6

Please note that the image will be on top of the text so you will have to solve this somehow.

Maybe by printing new lines in a loop to the point where the text is basically where you want it?