c3tracker:repair

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
c3tracker:repair [2019/07/03 17:23] – [Cur the last second off a recording] bjoernc3tracker:repair [2020/01/16 22:44] – add ReLive to fusemount n0emis
Line 21: Line 21:
 Zum Reparieren der Timestamps wird das vorhandene, aber "kaputte" uncut.ts aus dem Fusemount nochmal mit FFmpeg remuxed, das Recordingticket muss sich also mindestens im Status "prepared" befinden, wobei kein SourceReplacement gesetzt sein darf: Zum Reparieren der Timestamps wird das vorhandene, aber "kaputte" uncut.ts aus dem Fusemount nochmal mit FFmpeg remuxed, das Recordingticket muss sich also mindestens im Status "prepared" befinden, wobei kein SourceReplacement gesetzt sein darf:
  
-  ffmpeg -i /video/event/room/1234/uncut.ts -c copy -f mpegts /video/tmp/event-repair/1234-remux.ts+  ffmpeg -i /video/fuse/event/room/1234/uncut.ts -c copy -f mpegts  -map 0:0 -map 0:1 -map 0:2 -map 0:3 /video/tmp/event/repair/1234-remux.ts
  
 Anschließend mit dem Reparaturprozess (nächster Abschnitt) fortfahren. Anschließend mit dem Reparaturprozess (nächster Abschnitt) fortfahren.
Line 34: Line 34:
  
 Ab hier läuft dann die Pipeline ganz normal weiter. Ab hier läuft dann die Pipeline ganz normal weiter.
 +
 +=== Camera backup Audio stereo to 2x stereo
 +
 +Soll der Kameraton benutzt werden liegt dieser meist als L: original R: translation vor. Das muss im repair.ts auf 2 stereo streams geaendert werden das sollte mit dieser zeile funktionieren:
 +<code>
 +ffmpeg -i repair_rl.ts -filter_complex "channelsplit=channel_layout=stereo[l][r]" -c:v copy -c:a mp2 -b:a 192k -ar:a 48000 -map 0:0 -map "[l]" -map "[r]" -ac 2 repair_2chan.ts
 +</code>
  
 == Hints for repairing / manual cutting with KDEnlive == Hints for repairing / manual cutting with KDEnlive
Line 69: Line 76:
     -c copy \     -c copy \
     -f mpegts /video/tmp/$EVENT/repair/${TALKID}_repair.ts     -f mpegts /video/tmp/$EVENT/repair/${TALKID}_repair.ts
-</code>+</code>können
 == Audiospur bearbeiten == Audiospur bearbeiten
  
Line 90: Line 97:
 </code> </code>
  
 +Weitere Audiospuren als nicht default markieren:
 +<code>
 +ffmpeg -i 10223-hd.mp4.orig -i /video/tmp/camp19/repair/10223-en-fixed.m4a -c copy -map 0:v:0 -map 0:v:1 -map 0:a:0 -map 1:a:0 -map_metadata 0 -metadata:s:a:1 language=eng -disposition:a:0 default -disposition:a:1 none 10223-hd.mp4
 +</code>
 +
 +Manuelles AV/Delay mit ffmpeg von 200ms korrigieren:
 +<code>
 +ffmpeg -i 10397-hd-async.mp4 -itsoffset 0.200 -i 10397-hd-async.mp4 -c copy -map 0:v:0 -map 0:v:1 -map 1:a:0 -map_metadata 0 10397-hd.mp4
 +</code>
 == Copyright aus audio mit hilfe von YouTube entfernen   == Copyright aus audio mit hilfe von YouTube entfernen  
  
Line 134: Line 150:
 Now place a ''Record.SourceReplacement'' propery on the Recording-Ticket and reset it to the ''recorded''-State. It will now be prepared from the repair-File instead of the Capture-Snippets. The repair-process will create a fuse-mount that needs to be cut again, at least ''inframe != 0'' - **this is very different from TS!** Now place a ''Record.SourceReplacement'' propery on the Recording-Ticket and reset it to the ''recorded''-State. It will now be prepared from the repair-File instead of the Capture-Snippets. The repair-process will create a fuse-mount that needs to be cut again, at least ''inframe != 0'' - **this is very different from TS!**
  
-== Cur the last second off a recording +== Cut the last second off a recording 
  
 When the outro has additional frames (bacause of a non empty output folder after a --debug run) the files can be shortened by downloading them from media and using the fowllowing script. When the outro has additional frames (bacause of a non empty output folder after a --debug run) the files can be shortened by downloading them from media and using the fowllowing script.
Line 141: Line 157:
 #!/bin/bash #!/bin/bash
  
-for video in *.mp4; do+EXT=".mp4" 
 + 
 +for video in *${EXT}; do
  echo "Processing $video"  echo "Processing $video"
  DURATION=$(ffprobe -v quiet -print_format json -show_format $video | jq '.format.duration|tonumber')  DURATION=$(ffprobe -v quiet -print_format json -show_format $video | jq '.format.duration|tonumber')
  DURATIONX2=$(ffprobe -v quiet -print_format json -show_format $video | jq '(.format.duration|tonumber)-1.3')  DURATIONX2=$(ffprobe -v quiet -print_format json -show_format $video | jq '(.format.duration|tonumber)-1.3')
  
- VIDEONAME=$(basename $video .mp4+ VIDEONAME=$(basename $video ${EXT}
- REPAIRNAME=repair/${VIDEONAME}.mp4+ REPAIRNAME=repair/${VIDEONAME}${EXT}
  echo "OLD: $DURATION"  echo "OLD: $DURATION"
  echo "NEW: ${DURATIONX2}"  echo "NEW: ${DURATIONX2}"
- echo ffmpeg -hide_banner -t $DURATIONX2 -i ${VIDEONAME}.mp4 -map 0 -c copy ${REPAIRNAME} + echo ffmpeg -hide_banner -t $DURATIONX2 -i ${VIDEONAME}${EXT} -map 0 -c copy ${REPAIRNAME} 
- ffmpeg -hide_banner -t $DURATIONX2 -i ${VIDEONAME}.mp4 -map 0 -c copy ${REPAIRNAME}+ ffmpeg -hide_banner -t $DURATIONX2 -i ${VIDEONAME}${EXT} -map 0 -c copy ${REPAIRNAME}
 done done
 </code> </code>
 +
 +== ReLive to fusemount
 +
 +If you for example screwed up a recording, it could be useful to use the ReLive-Snippets as a source for the fuse-ts. This python-script might help you. The Fahplan-ID has to be given as a argument.
 +
 +<code>
 +import os
 +import sys
 +
 +files = os.listdir('/video/tmp/ber-relive/36c3/5'+sys.argv[1])
 +relive_folder = '/video/tmp/ber-relive/36c3/5'
 +fuse_folder = '/video/fuse/36c3-wikipakawg/Wikipaka/'
 +
 +i = 0
 +
 +for file in files:
 +    filename = relive_folder+sys.argv[1]+'/' + file
 +    if filename[-3:] == '.ts':
 +        file = file.split('-')
 +        new_filename = relive_folder+sys.argv[1]+'/{}-{:05d}.ts'.format(file[0], int(file[1][:-3]))
 +        os.rename(filename, new_filename)
 +        i += 1
 +
 +print("sudo umount "+fuse_folder+sys.argv[1] + ' && sudo /usr/bin/fuse-ts p="{prefix}-" c="{relive_folder}{id}" st="0000" numfiles={num} totalframes={frames} -oallow_other,use_ino "{fuse_folder}{id}"'.format(id=sys.argv[1], prefix=file[0], num=i, frames=(150*i) + 1000,relive_folder=relive_folder,fuse_folder=fuse_folder))
 +</code>
 +
 +
  • c3tracker/repair.txt
  • Last modified: 2023/03/15 17:01
  • by jwacalex