• Post Reply Bookmark Topic Watch Topic
  • New Topic

Edit header of Movie  RSS feed

 
ibrahim yener
Ranch Hand
Posts: 202
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I want to add some random string very top my video file by editing Notepad++ and want to remove that string to play video.

If open a video file by Notepad++ following text will appear
    ftypisom   isomiso2avc1mp41
so, i want to add something like
dklfjhsdfkdsurytp3985utrjfakdsf    ftypisom   isomiso2avc1mp41 and save it
and want to remove that string by Java program.

So far i have succeeded:
1- Open video by Notepad++
2- Add random string top of file and save
3- Wrote a java code read file line by line
4- Remove that string by java and save file

However, after saving file by Java
video files doesn't open by VLC player or any other player.

How can i achieve that goal?

Any idea?
 
Tim Moores
Saloon Keeper
Posts: 3512
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't edit binary files in a text editor, nor can you just add lines to structured file formats. You can find libraries for working with movie file formats in the "Playing Media" section of the http://www.coderanch.com/t/659961/Wiki/Open-Source-Projects-Faq.

Let's take a step back, and tell us why you're trying to edit the file.
 
ibrahim yener
Ranch Hand
Posts: 202
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tim
Thanks for reply.

I open video files in notepad++ and string into it then save it. When i try to open video file through VLC doesn't appear even a single frame.

When i open file and remove just added string and save it then VLC plays it as usual.

What i want is that remove added string programmatically.
 
Tim Moores
Saloon Keeper
Posts: 3512
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You missed the point I was trying to make. Editing a movie file (or indeed any binary files) as if it was a text file is fundamentally misconceived, and can't be made to work.

What I asked is what you were trying to achieve by doing that. WHY do you think you need to do it? Focus on that rather than the HOW for the time being.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!