Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUGGESTED FEATURE - Map tile #190

Open
MarcFinns opened this issue Dec 19, 2021 · 8 comments
Open

SUGGESTED FEATURE - Map tile #190

MarcFinns opened this issue Dec 19, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@MarcFinns
Copy link

Hello, this is an idea to make use of the empty tiles in the output videos.

  • In one, the info from the event.json could be displayed (i.e. coordinates, city, timestamp)
  • In the other, a map with a red dot on the coordinates from event.json.
    Anyone interested?
@Bonscha
Copy link

Bonscha commented Dec 20, 2021

Great idea!

@SimonKagstrom
Copy link
Contributor

I also think it sounds like a good idea. For what it's worth, I added an option to prepend a map of the event location at the start of the video here, #154, which is now available after some fixups of my mistakes by @ehendrix23.

I don't know enough about ffmpeg to figure out how to add it in one of the empty tiles though, unfortunately.

@MarcFinns
Copy link
Author

I also think it sounds like a good idea. For what it's worth, I added an option to prepend a map of the event location at the start of the video here, #154, which is now available after some fixups of my mistakes by @ehendrix23.

This is actually a very good step, thanks. If you can generate already the one-frame video, looking at the code it should not be impossible to add it to one of the unused frames.

@ehendrix23 ehendrix23 added the enhancement New feature or request label Jan 13, 2022
@MarcFinns
Copy link
Author

Hi there, is this mod working on linux?
I get tesla_dashcam: error: unrecognized arguments: --title-screen-map

@SimonKagstrom
Copy link
Contributor

@MarcFinns , it should be --title_screen_map. I think it maybe changed since the first version of the pull request.

@hitnrun30
Copy link

I got an even bigger error, The entire video is the map.

@ehendrix23
Copy link
Owner

I got an even bigger error, The entire video is the map.

Can you open another issue for this and then run it with DEBUG log level and provide that together with full command (including parameters)?

@Javex
Copy link

Javex commented Jun 7, 2023

I ran a little test and figured out how to add a map tile in the top left corner with a manual ffmpeg command based on what the script generates. The magic line was this:

[right1][map] overlay=eof_action=repeat:repeatlast=1:x=0:y=0 [map1];

The important bit is to turn on "repeat" and set "repeatlast=1" or it'll just flash the image briefly and go black.

You also need to add a new input with the map image (most of the code is already there from the title screen option).

I'm not familiar enough with the script to turn this into a full PR, esp. when you want to support multiple layouts and such, but it might be a good starting point.

My full command looks something like this:

cmd = ['ffmpeg',
 '-loglevel',
 'info',
 '-i',
 'test_data/2023-05-26_14-04-18/2023-05-26_14-03-15-front.mp4',
 '-i',
 'test_data/2023-05-26_14-04-18/2023-05-26_14-03-15-back.mp4',
 '-i',
 'test_data/2023-05-26_14-04-18/2023-05-26_14-03-15-left_repeater.mp4',
 '-i',
 'test_data/2023-05-26_14-04-18/2023-05-26_14-03-15-right_repeater.mp4',
 '-i',
 'test_data/map.png',
 '-filter_complex',
    'color=duration=59.85:s=1920x960:c=black, fps=24 [base];'
    '[0:v] setpts=PTS-STARTPTS, scale=640x480  [front];'
    '[1:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [rear];'
    '[2:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [left];'
    '[3:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [right];'
    '[4]null[map];'
    '[base][front] overlay=eof_action=pass:repeatlast=0:x=640:y=0 [front1];'
    '[front1][rear] overlay=eof_action=pass:repeatlast=0:x=640:y=480 [rear1];'
    '[rear1][left] overlay=eof_action=pass:repeatlast=0:x=0:y=480 [left1];'
    '[left1][right] overlay=eof_action=pass:repeatlast=0:x=1280:y=480 [right1];'
    '[right1][map] overlay=eof_action=repeat:repeatlast=1:x=0:y=0 [map1];'
    "[map1] drawtext=fontfile=/usr/share/fonts/opentype/freefont/FreeSans.otf:fontcolor=white:fontsize=24:borderw=2:[email protected]:x=(w/2-text_w/2):y=(h-(text_h)-10):text='%{pts\\:localtime\\:1685075595\\:%x "
    "%X}' [tmp0]",
 '-map',
 '[tmp0]',
 '-preset',
 'medium',
 '-crf',
 '28',
 '-c:v',
 'libx264',
 '-metadata',
 'creation_time=2023-05-26T04:33:15.000000Z',
 '-metadata',
 'description=Created by tesla_dashcam v0.1.21b2',
 '-metadata',
 'title=SENTRY: 05/26/23 14:03:19',
 '-y',
 'test_data/output/2023-05-26T14-03-15.mp4']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants