I have few wav files, which i am not be read using the wave module of python.
I get the following error:
wav = wave.open("filename.wav")
error:
"wave.Error: unknown format: %r"
I checked the encoding on the file using ffmpeg -i "filename.wav".
This is the output in metadata:
My question is
How do i remove this encoding from the wav file?
if you can point me in a direction
(i have already tried to find a decoder but was not successful)
Related
I was wondering if it is possible to run densepose annotations on a mp4 with detectron2?
In the projects folder, you can run densepose with applynet.py but this only works on images. I tried running this commmand
d demo/
python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
--video-input video.mp4 \
[--other-options]
--opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
with densepose weights and annotations but Detectron2 gives me this error:
Non-existent config key: MODEL.DENSEPOSE_ON
I know DensePose video exists but it is out of date as it uses caffe2 separated from pytorch.
Is this possible or can you not run on video?
Easiest approach is to use something like ffmpeg to split your video into frames, and then run detectron2 on each frame.
I have generated a box file from a png image then I followed this tutorial:
https://pretius.com/how-to-prepare-training-files-for-tesseract-ocr-and-improve-characters-recognition/ to generate custom traineddata file.
I encountered an error when I tried to use the generated traineddata alongside with Pytesseract.
and i got this kind of error:
raise TesseractError(proc.returncode, get_errors(error_string))
pytesseract.pytesseract.TesseractError: (-4, "read_params_file:
Can't open txt read_params_file: Can't open txt read_params_file: Can't open txt read_params_file: Can't open txt Error: LSTM requested, but not present!! Loading tesseract. mgr->GetComponent(TESSDATA_NORMPROTO, &fp)
:Error:Assert failed:in file adaptmatch.cpp, line 552")
I'm using Tesseract version 5.0
This is my config options
traineddata = f'+eng+lav+lav2'
config = f'-l {traineddata} --oem 1 --psm 3 {tessdata_dir}'
I followed the same tutorial and encountered the exact same error. At my first tries the ***.traineddata didn't generated well, and I findout that one file was missing (normproto). So I just cleaned all the generated files (except the corrected .box files) and rerun the train process, and everything worked fine on the second attempt.
I am working on a scenario where I need to read Avro container files from HDFS and do analysis using Spark.
Input Files Directory: hdfs:///user/learner/20151223/.lzo*
Note : The Input Avro Files are lzo compressed.
val df = sqlContext.read.avro("/user/learner/20151223/*.lzo");
When I run the above command.It throws an error :
java.io.FileNotFoundException: No avro files present at file:/user/learner/20151223/*.lzo
at com.databricks.spark.avro.AvroRelation$$anonfun$11.apply(AvroRelation.scala:225)
at com.databricks.spark.avro.AvroRelation$$anonfun$11.apply(AvroRelation.scala:225)
at scala.Option.getOrElse(Option.scala:120)
at com.databricks.spark.avro.AvroRelation.newReader(AvroRelation.scala:225)
This make sense,because the method read.avro() is expecting .avro extension files as input.So I extract and rename the input .lzo file to .avro.I am able to read the data in avro file properly.
Is there any way to read lzo compressed Avro files in spark ?
Solution worked, But !
I have found a way to solve this issue. I created a shell wrapper in which I have decompressed the .lzo into .avro file format using following way:
hadoop fs -text <file_path>*.lzo | hadoop fs - put - <file_path>.avro
I am successfull in decompressing lzo files but the problem is I am having atleast 5000 files in compressed format.Uncompressing and Converting one by one is taking nearly 1+ hours to run this Job.
Is there any way to do this Decompression in bulk way ?
Thanks again !
I am using unoconv to convert an ods spreadsheet to a csv file.
Here is the command:
unoconv -vvv --doctype=spreadsheet --format=csv --output= ~/Dropbox
/mariners_site/textFiles/expenses.csv ~/Dropbox/Aldeburgh/expenses
/expenses.ods
It saves the output file in the same directory as the source file, not in the specified directory. The error message is:
Output file: /home/richard/Dropbox/mariners_site/textFiles/expenses.csv
unoconv: UnoException during export phase:
Unable to store document to file:///home/richard/Dropbox/mariners_site
/textFiles/expenses.csv (ErrCode 19468)
I'm sure that this worked initially, but it has since stopped.
I have checked for permissions and they are identical for both directories.
I translated ErrCode 19468 for you and it boils down to meaning ERRCODE_SFX_DOCUMENTREADONLY.
You can find more information about the specific meaning of LibreOffice ErrCode numbers from the unoconv documentation at: https://github.com/dagwieers/unoconv/blob/master/doc/errcode.adoc
The clue here is that you have a whitespace-character between --output= and the filename (--output= ~/Dropbox
/mariners_site/textFiles/expenses.csv) and because of that unoconv gets an empty output value (which means the current directory) and is given 2 files. And that explains why you get this specific error IMO
Does anyone know how to extract teletext subtitles?
I have tried ffmpeg, it says
Invalid frame dimensions 0x0
CCExtractor, it says
"Missing ASF header. Abort
telxcc, it says
! Invalid TS packet header; TS seems to be misaligned
I have done a lot of research, but have no luck. Can anyone offer some help!
dvb_subtitles cannot be extracted with ffmpeg easily because is an image that overlays the original. Good explanation: https://stackoverflow.com/a/20887655/2119685
There is a way to extract the dvb_teletext, which normally includes the subtiltes too.
Install the next dependency:
sudo apt-get install libzvbi-dev
Then recompile from source ffmpeg with:
--enable-libzvbi
Good tutorial here on how to compile FFMPEG from source -https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
Then execute the next command to fetch the subtitles to a .srt file:
ffmpeg -txt_format text -i INPUT1 -an -vn -scodec srt test.srt
And voila, your .srt subtitles will be in test.srt
Did you try using gstreamer ? appsrc->tsdemux->fakesink. Make pipeline like this, and then get the PES data from fakesink callback.